index.css73 lines, 1.9 KB
| 1 | @import 'tailwindcss'; |
| 2 | @import '@fontsource-variable/inter'; |
| 3 | |
| 4 | /* dark: follows the class on <html>, which index.html sets */ |
| 5 | @custom-variant dark (&:where(.dark, .dark *)); |
| 6 | |
| 7 | /* The design tokens. Each is a utility too: bg-paper, text-mute… */ |
| 8 | @theme { |
| 9 | --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif; |
| 10 | --color-paper: #fbfaf8; |
| 11 | --color-ink: #26272b; |
| 12 | --color-mute: #66666e; |
| 13 | --color-line: #e6e4df; |
| 14 | --color-hover: #f1efeb; |
| 15 | --color-accent: #f5b13d; |
| 16 | --color-on-accent: #26272b; |
| 17 | --color-accent-ink: #9a5b00; |
| 18 | --animate-pop: pop 300ms ease-out; |
| 19 | --animate-drop: drop 250ms ease-out; |
| 20 | @keyframes pop { |
| 21 | 50% { |
| 22 | transform: scale(1.3); |
| 23 | } |
| 24 | } |
| 25 | @keyframes drop { |
| 26 | from { |
| 27 | transform: translateY(-0.5rem); |
| 28 | opacity: 0; |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /* Dark is the same tokens with other values: no dark: everywhere */ |
| 34 | .dark { |
| 35 | --color-paper: #1b1c1f; |
| 36 | --color-ink: #ececee; |
| 37 | --color-mute: #9c9ca5; |
| 38 | --color-line: #2f3035; |
| 39 | --color-hover: #26272b; |
| 40 | --color-on-accent: #1b1c1f; |
| 41 | --color-accent-ink: #f5b13d; |
| 42 | color-scheme: dark; |
| 43 | } |
| 44 | |
| 45 | @layer base { |
| 46 | body { |
| 47 | @apply bg-paper font-sans text-ink antialiased; |
| 48 | } |
| 49 | :focus-visible { |
| 50 | @apply rounded-sm outline-2 outline-offset-2 outline-accent; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /* Single elements used everywhere. Anything bigger is a component. */ |
| 55 | @layer components { |
| 56 | .btn { |
| 57 | @apply rounded-full bg-accent px-4 py-1.5 text-sm font-medium; |
| 58 | @apply text-on-accent hover:brightness-95; |
| 59 | @apply disabled:bg-hover disabled:text-mute disabled:brightness-100; |
| 60 | } |
| 61 | .btn-quiet { |
| 62 | @apply rounded-full border border-line px-4 py-1.5 text-sm; |
| 63 | @apply font-medium hover:bg-hover; |
| 64 | } |
| 65 | .field { |
| 66 | @apply w-full rounded-lg border border-line bg-transparent px-3; |
| 67 | @apply py-2 placeholder:text-mute focus:border-mute; |
| 68 | } |
| 69 | .bar { |
| 70 | @apply sticky top-0 z-10 border-b border-line bg-paper/90 px-4; |
| 71 | @apply py-3 font-semibold backdrop-blur; |
| 72 | } |
| 73 | } |