Skip to content

Commit

Permalink
refactor: use Record type
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Dec 11, 2023
1 parent 45c4ed5 commit a288e6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ function oklchCoords(color: string) {
type ColorGroup = "primary" | "neutral" | "danger";
type ColorLevel = 0 | 1 | 2 | 3 | 4 | 5;

type ColorFamily<T extends ColorGroup> = {
[P in `--color-${T}-${ColorLevel}`]: string;
};
type ColorFamily<T extends ColorGroup> = Record<
`--color-${T}-${ColorLevel}`,
string
>;

interface Theme extends ColorFamily<ColorGroup> {}

Expand Down

0 comments on commit a288e6f

Please sign in to comment.