|
| 1 | +/* |
| 2 | + Figma Variables |
| 3 | + figma blur variables are equivalent to 40% opacity |
| 4 | + e.g. tw-slate/050-blur => color-slate-50 / 40 |
| 5 | + to create a variable with defined opacity, follow the tailwind solution: |
| 6 | + --<var-name>: color-mix(in oklab, var(<base-color-var>) <opacity>, transparent); |
| 7 | +*/ |
| 8 | + |
| 9 | +:root { |
| 10 | + /* neutrals */ |
| 11 | + --figma-background: var(--color-slate-100); |
| 12 | + --figma-background-blur: color-mix(in oklab, var(--color-slate-50) 40%, transparent); |
| 13 | + --figma-grey: var(--color-slate-300); |
| 14 | + --figma-text-primary: var(--color-slate-950); |
| 15 | + --figma-text-secondary: var(--color-slate-500); |
| 16 | + --figma-text-accent-darkbg: var(--color-slate-100); |
| 17 | + --figma-text-accent-lightbg: var(--color-slate-900); |
| 18 | + /* accents */ |
| 19 | + --figma-red: var(--color-rose-600); |
| 20 | + --figma-green: var(--color-emerald-400); |
| 21 | + --figma-blue-primary: var(--color-blue-400); |
| 22 | + --figma-blue-primary-blur: color-mix(in oklab, var(--color-slate-400) 40%, transparent); |
| 23 | + --figma-blue-secondary: var(--color-sky-700); |
| 24 | + --figma-blue-tertiary: var(--color-sky-300); |
| 25 | + --figma-blue-tertiary-blur: color-mix(in oklab, var(--color-sky-300) 40%, transparent); |
| 26 | + /* buttons */ |
| 27 | + --figma-button-primary: var(--figma-blue-primary); |
| 28 | + --figma-button-secondary: var(--figma-blue-secondary); |
| 29 | + --figma-button-tertiary: var(--figma-blue-tertiary); |
| 30 | + --figma-button-error: var(--figma-red); |
| 31 | + --figma-button-disabled: var(--figma-grey); |
| 32 | + /* radius */ |
| 33 | + --figma-corner-images: 10px; |
| 34 | + --figma-corner-rectangles: 20px; |
| 35 | + --figma-corner-buttonsM: 60px; |
| 36 | + --figma-corner-buttonsL: 100px; |
| 37 | +} |
| 38 | + |
| 39 | +.dark { |
| 40 | + /* Figma Variables */ |
| 41 | + /* neutrals */ |
| 42 | + --figma-background: oklch(35.13% 0.062 249.28); |
| 43 | + --figma-background-blur: oklch(39.07% 0.089 240.61 / 40%); |
| 44 | + --figma-grey: var(--color-slate-400); |
| 45 | + --figma-text-primary: var(--color-slate-50); |
| 46 | + --figma-text-secondary: var(--color-slate-400); |
| 47 | + --figma-text-accent-darkbg: var(--color-slate-100); |
| 48 | + --figma-text-accent-lightbg: var(--color-slate-900); |
| 49 | + /* accents */ |
| 50 | + --figma-red: var(--color-rose-800); |
| 51 | + --figma-green: var(--color-emerald-600); |
| 52 | + --figma-blue-primary: var(--color-blue-800); |
| 53 | + --figma-blue-primary-blur: oklch(42.42% 0.198 265.5 / 40%); |
| 54 | + --figma-blue-secondary: var(--color-sky-900); |
| 55 | + --figma-blue-tertiary: var(--color-sky-700); |
| 56 | + --figma-blue-tertiary-blur: oklch(50.40% 0.128 245.46 / 40%); |
| 57 | + /* buttons and radius are the same as in the light theme */ |
| 58 | +} |
| 59 | + |
| 60 | +/* |
| 61 | + Use `inline` when referencing other css variables |
| 62 | + https://tailwindcss.com/docs/theme#referencing-other-variables |
| 63 | +*/ |
| 64 | +@theme inline { |
| 65 | + --color-background: var(--figma-background); |
| 66 | + --color-text-primary: var(--figma-text-primary); |
| 67 | + |
| 68 | + /* neutrals */ |
| 69 | + --color-background: var(--figma-background); |
| 70 | + --color-background-blur: var(--figma-background-blur); |
| 71 | + --color-grey: var(--figma-grey); |
| 72 | + --color-text-primary: var(--figma-text-primary); |
| 73 | + --color-text-secondary: var(--figma-text-secondary); |
| 74 | + --color-text-accent-darkbg: var(--figma-text-accent-darkbg); |
| 75 | + --color-text-accent-lightbg: var(--figma-text-accent-lightbg); |
| 76 | + /* accents */ |
| 77 | + --color-red: var(--figma-red); |
| 78 | + --color-green: var(--figma-green); |
| 79 | + --color-blue-primary: var(--figma-blue-primary); |
| 80 | + --color-blue-primary-blur: var(--figma-blue-primary-blur); |
| 81 | + --color-blue-secondary: var(--figma-blue-secondary); |
| 82 | + --color-blue-tertiary: var(--figma-blue-tertiary); |
| 83 | + --color-blue-tertiary-blur: var(--figma-blue-tertiary-blur); |
| 84 | + /* buttons */ |
| 85 | + --color-button-primary: var(--figma-button-primary); |
| 86 | + --color-button-secondary: var(--figma-button-secondary); |
| 87 | + --color-button-tertiary: var(--figma-button-tertiary); |
| 88 | + --color-button-error: var(--figma-button-error); |
| 89 | + --color-button-disabled: var(--figma-button-disabled); |
| 90 | + /* radius */ |
| 91 | + --radius-images: var(--figma-corner-images); |
| 92 | + --radius-rectangles: var(--figma-corner-rectangles); |
| 93 | + --radius-buttonsM: var(--figma-corner-buttonsM); |
| 94 | + --radius-buttonsL: var(--figma-corner-buttonsL); |
| 95 | +} |
0 commit comments