Skip to content

Commit

Permalink
Move figma name mapping to preset
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Jan 13, 2025
1 parent 8f30048 commit 7859366
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
23 changes: 17 additions & 6 deletions packages/ui-next/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,46 @@ export const cartridgeTWPreset: Partial<Config> = {
colors: {
transparent: "transparent",
current: "currentColor",
border: "hsl(var(--border)/0.12)",
input: "hsl(var(--input)/0.12)",
background: {
// bg-background
DEFAULT: "hsl(var(--background))",
// solid-fills/bg-primary
100: "hsl(var(--background-100))",
// solid-fills/bg-secondary
200: "hsl(var(--background-200))",
300: "hsl(var(--background-200))",
// solid-fills/bg-tertiary
300: "hsl(var(--background-300))",
},
// text-primary
foreground: "hsl(var(--foreground))",
primary: {
// Overridden by theme.colors.primary
DEFAULT: "hsl(var(--primary))",
// Overridden by theme.colors.primaryForeground
foreground: "hsl(var(--primary-foreground))",
},
// Mainly for Duotone icons
secondary: "hsl(var(--secondary))",
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
// TODO: bg.muted
DEFAULT: "hsl(var(--muted))",
// TODO: text.secondary
foreground: "hsl(var(--muted-foreground))",
},
accent: {
// TODO: bg.accent
DEFAULT: "hsl(var(--accent))",
// TODO: text.secondary-accent
foreground: "hsl(var(--accent-foreground))",
},
spacer: {
DEFAULT: "hsl(var(--spacer))",
},
border: "hsl(var(--background)/0.12)",
input: "hsl(var(--background-200)/0.12)",
// solid-fills/spacer
spacer: "hsl(var(--spacer))",
},
extend: {
fontFamily: {
Expand Down
29 changes: 13 additions & 16 deletions packages/ui-next/src/themes/dark.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
@layer base {
.dark {
--background: 135 8% 9%; /* bg.background */
--background-100: 135 6% 13%; /* bg.primary */
--background-200: 120 7.5% 15.69%; /* bg.secondary */
--background-300: 120 11% 18%; /* bg.tertiary */
--background: 135 8% 9%;
--background-100: 135 6% 13%;
--background-200: 120 7.5% 15.69%;
--background-300: 120 11% 18%;

--foreground: 0 0% 100%; /* text.primary */
--foreground: 0 0% 100%;

--primary: 44 96% 61%; /* brand.primary */
--primary-foreground: 0 0% 100%; /* default to foreground, overridden by preset */
--secondary: 120 57% 78%; /* Mainly for Duotone icons */
--primary: 44 96% 61%;
--primary-foreground: 0 0% 0%;
--secondary: 120 57% 78%;

--muted: 132 8% 24%; /* bg.muted */
--muted-foreground: 0 0% 50%; /* text.secondary */
--muted: 132 8% 24%;
--muted-foreground: 0 0% 50%;

--accent: 132 4% 23%; /* bg.accent */
--accent-foreground: 0 0% 61%; /* text.secondary-accent */
--accent: 132 4% 23%;
--accent-foreground: 0 0% 61%;

--border: 135 8% 9%; /* bg.background */
--input: 120 7.5% 15.69%; /* bg.secondary */

--spacer: 132 14% 7%; /* solid-fills/spacer */
--spacer: 132 14% 7%;
}
}
6 changes: 2 additions & 4 deletions packages/ui-next/src/themes/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
--foreground: 0 0% 0%;

--primary: 255 73% 61%;
--primary-foreground: 0 0% 0%;
--primary-foreground: 0 0% 100%;
--secondary: 255 73% 61%;

--muted: 207 15% 85%;
Expand All @@ -20,9 +20,7 @@
--destructive: 0 72% 65%;
--destructive-foreground: 0 72% 65%;

--border: 220 60% 99%;
--input: 210 2.48% 94.9%; /* bg.secondary */
--spacer: 0 0% 0%; /* solid-fills/spacer */
--spacer: 0 0% 0%;

--radius: 0.5rem;
}
Expand Down

0 comments on commit 7859366

Please sign in to comment.