mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 01:49:43 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
426 B
TypeScript
21 lines
426 B
TypeScript
import type { Color } from "@yaakapp-internal/plugins";
|
|
|
|
const colors: Record<Color, boolean> = {
|
|
primary: true,
|
|
secondary: true,
|
|
success: true,
|
|
notice: true,
|
|
warning: true,
|
|
danger: true,
|
|
info: true,
|
|
};
|
|
|
|
export function stringToColor(str: string | null): Color | null {
|
|
if (!str) return null;
|
|
const strLower = str.toLowerCase();
|
|
if (strLower in colors) {
|
|
return strLower as Color;
|
|
}
|
|
return null;
|
|
}
|