Skip to content

Commit 3244da8

Browse files
authored
Sort theme variables in a more intentional order (#14952)
This PR updates our default `theme.css` file and organizes the CSS variables in a custom order that's optimized for looking nice in Chrome dev tools. You can only see ~50 variables "above the fold" in dev tools without clicking "Show all", so I've opted for putting variables near the top that have the highest "impact" on the design/brand of the site, and also showcase some of the modern CSS features we are using in Tailwind CSS v4. Here's what it looks like: <kbd><img width="957" alt="image" src="https://github.com/user-attachments/assets/dade9244-6e22-4822-ac5c-ffa33e895f6e"></kbd> I really want to show off the color palette because the swatches look nice and because seeing `oklch` there feels like a nice signal for Tailwind CSS v4 being very modern, but we have a lot of colors so you can't really fit much else if you do this. I stuck font families at the top since it's one of the few things that we can fit there that also feels important to your site's brand but still has few enough values not to push away the color palette. Co-authored-by: Adam Wathan <[email protected]>
1 parent 6177ca9 commit 3244da8

File tree

3 files changed

+345
-363
lines changed

3 files changed

+345
-363
lines changed

packages/@tailwindcss-postcss/src/__snapshots__/index.test.ts.snap

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,9 @@
33
exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
44
"@layer theme {
55
:root {
6-
--default-transition-duration: .15s;
7-
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
8-
--default-font-family: var(--font-sans);
9-
--default-font-feature-settings: var(--font-sans--font-feature-settings);
10-
--default-font-variation-settings: var(--font-sans--font-variation-settings);
11-
--default-mono-font-family: var(--font-mono);
12-
--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);
13-
--default-mono-font-variation-settings: var(--font-mono--font-variation-settings);
14-
--breakpoint-sm: 40rem;
15-
--breakpoint-md: 48rem;
16-
--breakpoint-lg: 64rem;
17-
--breakpoint-xl: 80rem;
18-
--breakpoint-2xl: 96rem;
19-
--color-black: #000;
20-
--color-white: #fff;
21-
--color-slate-50: oklch(.984 .003 247.858);
22-
--color-slate-100: oklch(.968 .007 247.896);
23-
--color-slate-200: oklch(.929 .013 255.508);
24-
--color-slate-300: oklch(.869 .022 252.894);
25-
--color-slate-400: oklch(.704 .04 256.788);
26-
--color-slate-500: oklch(.554 .046 257.417);
27-
--color-slate-600: oklch(.446 .043 257.281);
28-
--color-slate-700: oklch(.372 .044 257.287);
29-
--color-slate-800: oklch(.279 .041 260.031);
30-
--color-slate-900: oklch(.208 .042 265.755);
31-
--color-slate-950: oklch(.129 .042 264.695);
32-
--color-gray-50: oklch(.985 .002 247.839);
33-
--color-gray-100: oklch(.967 .003 264.542);
34-
--color-gray-200: oklch(.928 .006 264.531);
35-
--color-gray-300: oklch(.872 .01 258.338);
36-
--color-gray-400: oklch(.707 .022 261.325);
37-
--color-gray-500: oklch(.551 .027 264.364);
38-
--color-gray-600: oklch(.446 .03 256.802);
39-
--color-gray-700: oklch(.373 .034 259.733);
40-
--color-gray-800: oklch(.278 .033 256.848);
41-
--color-gray-900: oklch(.21 .034 264.665);
42-
--color-gray-950: oklch(.13 .028 261.692);
43-
--color-zinc-50: oklch(.985 0 0);
44-
--color-zinc-100: oklch(.967 .001 286.375);
45-
--color-zinc-200: oklch(.92 .004 286.32);
46-
--color-zinc-300: oklch(.871 .006 286.286);
47-
--color-zinc-400: oklch(.705 .015 286.067);
48-
--color-zinc-500: oklch(.552 .016 285.938);
49-
--color-zinc-600: oklch(.442 .017 285.786);
50-
--color-zinc-700: oklch(.37 .013 285.805);
51-
--color-zinc-800: oklch(.274 .006 286.033);
52-
--color-zinc-900: oklch(.21 .006 285.885);
53-
--color-zinc-950: oklch(.141 .005 285.823);
54-
--color-neutral-50: oklch(.985 0 0);
55-
--color-neutral-100: oklch(.97 0 0);
56-
--color-neutral-200: oklch(.922 0 0);
57-
--color-neutral-300: oklch(.87 0 0);
58-
--color-neutral-400: oklch(.708 0 0);
59-
--color-neutral-500: oklch(.556 0 0);
60-
--color-neutral-600: oklch(.439 0 0);
61-
--color-neutral-700: oklch(.371 0 0);
62-
--color-neutral-800: oklch(.269 0 0);
63-
--color-neutral-900: oklch(.205 0 0);
64-
--color-neutral-950: oklch(.145 0 0);
65-
--color-stone-50: oklch(.985 .001 106.423);
66-
--color-stone-100: oklch(.97 .001 106.424);
67-
--color-stone-200: oklch(.923 .003 48.717);
68-
--color-stone-300: oklch(.869 .005 56.366);
69-
--color-stone-400: oklch(.709 .01 56.259);
70-
--color-stone-500: oklch(.553 .013 58.071);
71-
--color-stone-600: oklch(.444 .011 73.639);
72-
--color-stone-700: oklch(.374 .01 67.558);
73-
--color-stone-800: oklch(.268 .007 34.298);
74-
--color-stone-900: oklch(.216 .006 56.043);
75-
--color-stone-950: oklch(.147 .004 49.25);
6+
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
7+
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
8+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
769
--color-red-50: oklch(.971 .013 17.38);
7710
--color-red-100: oklch(.936 .032 17.717);
7811
--color-red-200: oklch(.885 .062 18.334);
@@ -260,42 +193,69 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
260193
--color-rose-800: oklch(.455 .188 13.697);
261194
--color-rose-900: oklch(.41 .159 10.272);
262195
--color-rose-950: oklch(.271 .105 12.094);
263-
--animate-spin: spin 1s linear infinite;
264-
--animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite;
265-
--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
266-
--animate-bounce: bounce 1s infinite;
267-
--blur-xs: 4px;
268-
--blur-sm: 8px;
269-
--blur-md: 12px;
270-
--blur-lg: 16px;
271-
--blur-xl: 24px;
272-
--blur-2xl: 40px;
273-
--blur-3xl: 64px;
274-
--radius-xs: .125rem;
275-
--radius-sm: .25rem;
276-
--radius-md: .375rem;
277-
--radius-lg: .5rem;
278-
--radius-xl: .75rem;
279-
--radius-2xl: 1rem;
280-
--radius-3xl: 1.5rem;
281-
--radius-4xl: 2rem;
282-
--shadow-2xs: 0 1px #0000000d;
283-
--shadow-xs: 0 1px 2px 0 #0000000d;
284-
--shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
285-
--shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
286-
--shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
287-
--shadow-xl: 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;
288-
--shadow-2xl: 0 25px 50px -12px #00000040;
289-
--inset-shadow-2xs: inset 0 1px #0000000d;
290-
--inset-shadow-xs: inset 0 1px 1px #0000000d;
291-
--inset-shadow-sm: inset 0 2px 4px #0000000d;
292-
--drop-shadow-xs: 0 1px 1px #0000000d;
293-
--drop-shadow-sm: 0 1px 2px #0000001a, 0 1px 1px #0000000f;
294-
--drop-shadow-md: 0 4px 3px #00000012, 0 2px 2px #0000000f;
295-
--drop-shadow-lg: 0 10px 8px #0000000a, 0 4px 3px #0000001a;
296-
--drop-shadow-xl: 0 20px 13px #00000008, 0 8px 5px #00000014;
297-
--drop-shadow-2xl: 0 25px 25px #00000026;
196+
--color-slate-50: oklch(.984 .003 247.858);
197+
--color-slate-100: oklch(.968 .007 247.896);
198+
--color-slate-200: oklch(.929 .013 255.508);
199+
--color-slate-300: oklch(.869 .022 252.894);
200+
--color-slate-400: oklch(.704 .04 256.788);
201+
--color-slate-500: oklch(.554 .046 257.417);
202+
--color-slate-600: oklch(.446 .043 257.281);
203+
--color-slate-700: oklch(.372 .044 257.287);
204+
--color-slate-800: oklch(.279 .041 260.031);
205+
--color-slate-900: oklch(.208 .042 265.755);
206+
--color-slate-950: oklch(.129 .042 264.695);
207+
--color-gray-50: oklch(.985 .002 247.839);
208+
--color-gray-100: oklch(.967 .003 264.542);
209+
--color-gray-200: oklch(.928 .006 264.531);
210+
--color-gray-300: oklch(.872 .01 258.338);
211+
--color-gray-400: oklch(.707 .022 261.325);
212+
--color-gray-500: oklch(.551 .027 264.364);
213+
--color-gray-600: oklch(.446 .03 256.802);
214+
--color-gray-700: oklch(.373 .034 259.733);
215+
--color-gray-800: oklch(.278 .033 256.848);
216+
--color-gray-900: oklch(.21 .034 264.665);
217+
--color-gray-950: oklch(.13 .028 261.692);
218+
--color-zinc-50: oklch(.985 0 0);
219+
--color-zinc-100: oklch(.967 .001 286.375);
220+
--color-zinc-200: oklch(.92 .004 286.32);
221+
--color-zinc-300: oklch(.871 .006 286.286);
222+
--color-zinc-400: oklch(.705 .015 286.067);
223+
--color-zinc-500: oklch(.552 .016 285.938);
224+
--color-zinc-600: oklch(.442 .017 285.786);
225+
--color-zinc-700: oklch(.37 .013 285.805);
226+
--color-zinc-800: oklch(.274 .006 286.033);
227+
--color-zinc-900: oklch(.21 .006 285.885);
228+
--color-zinc-950: oklch(.141 .005 285.823);
229+
--color-neutral-50: oklch(.985 0 0);
230+
--color-neutral-100: oklch(.97 0 0);
231+
--color-neutral-200: oklch(.922 0 0);
232+
--color-neutral-300: oklch(.87 0 0);
233+
--color-neutral-400: oklch(.708 0 0);
234+
--color-neutral-500: oklch(.556 0 0);
235+
--color-neutral-600: oklch(.439 0 0);
236+
--color-neutral-700: oklch(.371 0 0);
237+
--color-neutral-800: oklch(.269 0 0);
238+
--color-neutral-900: oklch(.205 0 0);
239+
--color-neutral-950: oklch(.145 0 0);
240+
--color-stone-50: oklch(.985 .001 106.423);
241+
--color-stone-100: oklch(.97 .001 106.424);
242+
--color-stone-200: oklch(.923 .003 48.717);
243+
--color-stone-300: oklch(.869 .005 56.366);
244+
--color-stone-400: oklch(.709 .01 56.259);
245+
--color-stone-500: oklch(.553 .013 58.071);
246+
--color-stone-600: oklch(.444 .011 73.639);
247+
--color-stone-700: oklch(.374 .01 67.558);
248+
--color-stone-800: oklch(.268 .007 34.298);
249+
--color-stone-900: oklch(.216 .006 56.043);
250+
--color-stone-950: oklch(.147 .004 49.25);
251+
--color-black: #000;
252+
--color-white: #fff;
298253
--spacing: .25rem;
254+
--breakpoint-sm: 40rem;
255+
--breakpoint-md: 48rem;
256+
--breakpoint-lg: 64rem;
257+
--breakpoint-xl: 80rem;
258+
--breakpoint-2xl: 96rem;
299259
--container-3xs: 16rem;
300260
--container-2xs: 18rem;
301261
--container-xs: 20rem;
@@ -310,9 +270,6 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
310270
--container-6xl: 72rem;
311271
--container-7xl: 80rem;
312272
--container-prose: 65ch;
313-
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
314-
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
315-
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
316273
--text-xs: .75rem;
317274
--text-xs--line-height: 1rem;
318275
--text-sm: .875rem;
@@ -359,14 +316,57 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
359316
--leading-normal: 1.5;
360317
--leading-relaxed: 1.625;
361318
--leading-loose: 2;
319+
--radius-xs: .125rem;
320+
--radius-sm: .25rem;
321+
--radius-md: .375rem;
322+
--radius-lg: .5rem;
323+
--radius-xl: .75rem;
324+
--radius-2xl: 1rem;
325+
--radius-3xl: 1.5rem;
326+
--radius-4xl: 2rem;
327+
--shadow-2xs: 0 1px #0000000d;
328+
--shadow-xs: 0 1px 2px 0 #0000000d;
329+
--shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
330+
--shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
331+
--shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
332+
--shadow-xl: 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;
333+
--shadow-2xl: 0 25px 50px -12px #00000040;
334+
--inset-shadow-2xs: inset 0 1px #0000000d;
335+
--inset-shadow-xs: inset 0 1px 1px #0000000d;
336+
--inset-shadow-sm: inset 0 2px 4px #0000000d;
337+
--drop-shadow-xs: 0 1px 1px #0000000d;
338+
--drop-shadow-sm: 0 1px 2px #0000001a, 0 1px 1px #0000000f;
339+
--drop-shadow-md: 0 4px 3px #00000012, 0 2px 2px #0000000f;
340+
--drop-shadow-lg: 0 10px 8px #0000000a, 0 4px 3px #0000001a;
341+
--drop-shadow-xl: 0 20px 13px #00000008, 0 8px 5px #00000014;
342+
--drop-shadow-2xl: 0 25px 25px #00000026;
343+
--ease-in: cubic-bezier(.4, 0, 1, 1);
344+
--ease-out: cubic-bezier(0, 0, .2, 1);
345+
--ease-in-out: cubic-bezier(.4, 0, .2, 1);
346+
--animate-spin: spin 1s linear infinite;
347+
--animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite;
348+
--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
349+
--animate-bounce: bounce 1s infinite;
350+
--blur-xs: 4px;
351+
--blur-sm: 8px;
352+
--blur-md: 12px;
353+
--blur-lg: 16px;
354+
--blur-xl: 24px;
355+
--blur-2xl: 40px;
356+
--blur-3xl: 64px;
362357
--perspective-dramatic: 100px;
363358
--perspective-near: 300px;
364359
--perspective-normal: 500px;
365360
--perspective-midrange: 800px;
366361
--perspective-distant: 1200px;
367-
--ease-in: cubic-bezier(.4, 0, 1, 1);
368-
--ease-out: cubic-bezier(0, 0, .2, 1);
369-
--ease-in-out: cubic-bezier(.4, 0, .2, 1);
362+
--default-transition-duration: .15s;
363+
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
364+
--default-font-family: var(--font-sans);
365+
--default-font-feature-settings: var(--font-sans--font-feature-settings);
366+
--default-font-variation-settings: var(--font-sans--font-variation-settings);
367+
--default-mono-font-family: var(--font-mono);
368+
--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);
369+
--default-mono-font-variation-settings: var(--font-mono--font-variation-settings);
370370
}
371371
}
372372

0 commit comments

Comments
 (0)