Skip to content

Commit

Permalink
feat(themes): warning colors
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Dec 15, 2023
1 parent a288e6f commit 08da35e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function oklchCoords(color: string) {
return color.replace(/^oklch\((.+)\)$/u, "$1");
}

type ColorGroup = "primary" | "neutral" | "danger";
type ColorGroup = "primary" | "neutral" | "warning" | "danger";
type ColorLevel = 0 | 1 | 2 | 3 | 4 | 5;

type ColorFamily<T extends ColorGroup> = Record<
Expand Down Expand Up @@ -36,6 +36,13 @@ export const lightTheme = {
"--color-neutral-4": oklchCoords(colors.zinc[colorL4.light]),
"--color-neutral-5": oklchCoords(colors.zinc[colorL5.light]),

"--color-warning-0": oklchCoords(colors.yellow[colorL0.light]),
"--color-warning-1": oklchCoords(colors.yellow[colorL1.light]),
"--color-warning-2": oklchCoords(colors.yellow[colorL2.light]),
"--color-warning-3": oklchCoords(colors.yellow[colorL3.light]),
"--color-warning-4": oklchCoords(colors.yellow[colorL4.light]),
"--color-warning-5": oklchCoords(colors.yellow[colorL5.light]),

"--color-danger-0": oklchCoords(colors.red[colorL0.light]),
"--color-danger-1": oklchCoords(colors.red[colorL1.light]),
"--color-danger-2": oklchCoords(colors.red[colorL2.light]),
Expand All @@ -59,6 +66,13 @@ export const darkTheme = {
"--color-neutral-4": oklchCoords(colors.zinc[colorL4.dark]),
"--color-neutral-5": oklchCoords(colors.zinc[colorL5.dark]),

"--color-warning-0": oklchCoords(colors.yellow[colorL0.dark]),
"--color-warning-1": oklchCoords(colors.yellow[colorL1.dark]),
"--color-warning-2": oklchCoords(colors.yellow[colorL2.dark]),
"--color-warning-3": oklchCoords(colors.yellow[colorL3.dark]),
"--color-warning-4": oklchCoords(colors.yellow[colorL4.dark]),
"--color-warning-5": oklchCoords(colors.yellow[colorL5.dark]),

"--color-danger-0": oklchCoords(colors.red[colorL0.dark]),
"--color-danger-1": oklchCoords(colors.red[colorL1.dark]),
"--color-danger-2": oklchCoords(colors.red[colorL2.dark]),
Expand Down

0 comments on commit 08da35e

Please sign in to comment.