Skip to content

Instantly share code, notes, and snippets.

@adamwathan
Created February 17, 2024 21:14
Show Gist options
  • Save adamwathan/867ba103c861d244c61d8403072ac9b5 to your computer and use it in GitHub Desktop.
Save adamwathan/867ba103c861d244c61d8403072ac9b5 to your computer and use it in GitHub Desktop.
Early draft of Tailwind CSS v4.0 default theme
@theme {
/* Defaults */
--default-border-color: var(--colors-gray-200);
--default-border-width: 1px;
--default-placeholder-color: var(--colors-gray-400);
--default-transition-duration: 150ms;
--default-transition-timing-function: var(--transition-timing-function-in-out);
--default-ring-color: color-mix(in srgb, var(--colors-blue-500) 50%, transparent);
--default-ring-width: 3px;
/* Breakpoints */
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;
--breakpoint-2xl: 1536px;
/* Colors */
--colors-black: #000;
--colors-white: #fff;
--colors-slate-50: #f8fafc;
--colors-slate-100: #f1f5f9;
--colors-slate-200: #e2e8f0;
--colors-slate-300: #cbd5e1;
--colors-slate-400: #94a3b8;
--colors-slate-500: #64748b;
--colors-slate-600: #475569;
--colors-slate-700: #334155;
--colors-slate-800: #1e293b;
--colors-slate-900: #0f172a;
--colors-slate-950: #020617;
--colors-gray-50: #f9fafb;
--colors-gray-100: #f3f4f6;
--colors-gray-200: #e5e7eb;
--colors-gray-300: #d1d5db;
--colors-gray-400: #9ca3af;
--colors-gray-500: #6b7280;
--colors-gray-600: #4b5563;
--colors-gray-700: #374151;
--colors-gray-800: #1f2937;
--colors-gray-900: #111827;
--colors-gray-950: #030712;
--colors-zinc-50: #fafafa;
--colors-zinc-100: #f4f4f5;
--colors-zinc-200: #e4e4e7;
--colors-zinc-300: #d4d4d8;
--colors-zinc-400: #a1a1aa;
--colors-zinc-500: #71717a;
--colors-zinc-600: #52525b;
--colors-zinc-700: #3f3f46;
--colors-zinc-800: #27272a;
--colors-zinc-900: #18181b;
--colors-zinc-950: #09090b;
--colors-neutral-50: #fafafa;
--colors-neutral-100: #f5f5f5;
--colors-neutral-200: #e5e5e5;
--colors-neutral-300: #d4d4d4;
--colors-neutral-400: #a3a3a3;
--colors-neutral-500: #737373;
--colors-neutral-600: #525252;
--colors-neutral-700: #404040;
--colors-neutral-800: #262626;
--colors-neutral-900: #171717;
--colors-neutral-950: #0a0a0a;
--colors-stone-50: #fafaf9;
--colors-stone-100: #f5f5f4;
--colors-stone-200: #e7e5e4;
--colors-stone-300: #d6d3d1;
--colors-stone-400: #a8a29e;
--colors-stone-500: #78716c;
--colors-stone-600: #57534e;
--colors-stone-700: #44403c;
--colors-stone-800: #292524;
--colors-stone-900: #1c1917;
--colors-stone-950: #0c0a09;
--colors-red-50: #fef2f2;
--colors-red-100: #fee2e2;
--colors-red-200: #fecaca;
--colors-red-300: #fca5a5;
--colors-red-400: #f87171;
--colors-red-500: #ef4444;
--colors-red-600: #dc2626;
--colors-red-700: #b91c1c;
--colors-red-800: #991b1b;
--colors-red-900: #7f1d1d;
--colors-red-950: #450a0a;
--colors-orange-50: #fff7ed;
--colors-orange-100: #ffedd5;
--colors-orange-200: #fed7aa;
--colors-orange-300: #fdba74;
--colors-orange-400: #fb923c;
--colors-orange-500: #f97316;
--colors-orange-600: #ea580c;
--colors-orange-700: #c2410c;
--colors-orange-800: #9a3412;
--colors-orange-900: #7c2d12;
--colors-orange-950: #431407;
--colors-amber-50: #fffbeb;
--colors-amber-100: #fef3c7;
--colors-amber-200: #fde68a;
--colors-amber-300: #fcd34d;
--colors-amber-400: #fbbf24;
--colors-amber-500: #f59e0b;
--colors-amber-600: #d97706;
--colors-amber-700: #b45309;
--colors-amber-800: #92400e;
--colors-amber-900: #78350f;
--colors-amber-950: #451a03;
--colors-yellow-50: #fefce8;
--colors-yellow-100: #fef9c3;
--colors-yellow-200: #fef08a;
--colors-yellow-300: #fde047;
--colors-yellow-400: #facc15;
--colors-yellow-500: #eab308;
--colors-yellow-600: #ca8a04;
--colors-yellow-700: #a16207;
--colors-yellow-800: #854d0e;
--colors-yellow-900: #713f12;
--colors-yellow-950: #422006;
--colors-lime-50: #f7fee7;
--colors-lime-100: #ecfccb;
--colors-lime-200: #d9f99d;
--colors-lime-300: #bef264;
--colors-lime-400: #a3e635;
--colors-lime-500: #84cc16;
--colors-lime-600: #65a30d;
--colors-lime-700: #4d7c0f;
--colors-lime-800: #3f6212;
--colors-lime-900: #365314;
--colors-lime-950: #1a2e05;
--colors-green-50: #f0fdf4;
--colors-green-100: #dcfce7;
--colors-green-200: #bbf7d0;
--colors-green-300: #86efac;
--colors-green-400: #4ade80;
--colors-green-500: #22c55e;
--colors-green-600: #16a34a;
--colors-green-700: #15803d;
--colors-green-800: #166534;
--colors-green-900: #14532d;
--colors-green-950: #052e16;
--colors-emerald-50: #ecfdf5;
--colors-emerald-100: #d1fae5;
--colors-emerald-200: #a7f3d0;
--colors-emerald-300: #6ee7b7;
--colors-emerald-400: #34d399;
--colors-emerald-500: #10b981;
--colors-emerald-600: #059669;
--colors-emerald-700: #047857;
--colors-emerald-800: #065f46;
--colors-emerald-900: #064e3b;
--colors-emerald-950: #022c22;
--colors-teal-50: #f0fdfa;
--colors-teal-100: #ccfbf1;
--colors-teal-200: #99f6e4;
--colors-teal-300: #5eead4;
--colors-teal-400: #2dd4bf;
--colors-teal-500: #14b8a6;
--colors-teal-600: #0d9488;
--colors-teal-700: #0f766e;
--colors-teal-800: #115e59;
--colors-teal-900: #134e4a;
--colors-teal-950: #042f2e;
--colors-cyan-50: #ecfeff;
--colors-cyan-100: #cffafe;
--colors-cyan-200: #a5f3fc;
--colors-cyan-300: #67e8f9;
--colors-cyan-400: #22d3ee;
--colors-cyan-500: #06b6d4;
--colors-cyan-600: #0891b2;
--colors-cyan-700: #0e7490;
--colors-cyan-800: #155e75;
--colors-cyan-900: #164e63;
--colors-cyan-950: #083344;
--colors-sky-50: #f0f9ff;
--colors-sky-100: #e0f2fe;
--colors-sky-200: #bae6fd;
--colors-sky-300: #7dd3fc;
--colors-sky-400: #38bdf8;
--colors-sky-500: #0ea5e9;
--colors-sky-600: #0284c7;
--colors-sky-700: #0369a1;
--colors-sky-800: #075985;
--colors-sky-900: #0c4a6e;
--colors-sky-950: #082f49;
--colors-blue-50: #eff6ff;
--colors-blue-100: #dbeafe;
--colors-blue-200: #bfdbfe;
--colors-blue-300: #93c5fd;
--colors-blue-400: #60a5fa;
--colors-blue-500: #3b82f6;
--colors-blue-600: #2563eb;
--colors-blue-700: #1d4ed8;
--colors-blue-800: #1e40af;
--colors-blue-900: #1e3a8a;
--colors-blue-950: #172554;
--colors-indigo-50: #eef2ff;
--colors-indigo-100: #e0e7ff;
--colors-indigo-200: #c7d2fe;
--colors-indigo-300: #a5b4fc;
--colors-indigo-400: #818cf8;
--colors-indigo-500: #6366f1;
--colors-indigo-600: #4f46e5;
--colors-indigo-700: #4338ca;
--colors-indigo-800: #3730a3;
--colors-indigo-900: #312e81;
--colors-indigo-950: #1e1b4b;
--colors-violet-50: #f5f3ff;
--colors-violet-100: #ede9fe;
--colors-violet-200: #ddd6fe;
--colors-violet-300: #c4b5fd;
--colors-violet-400: #a78bfa;
--colors-violet-500: #8b5cf6;
--colors-violet-600: #7c3aed;
--colors-violet-700: #6d28d9;
--colors-violet-800: #5b21b6;
--colors-violet-900: #4c1d95;
--colors-violet-950: #2e1065;
--colors-purple-50: #faf5ff;
--colors-purple-100: #f3e8ff;
--colors-purple-200: #e9d5ff;
--colors-purple-300: #d8b4fe;
--colors-purple-400: #c084fc;
--colors-purple-500: #a855f7;
--colors-purple-600: #9333ea;
--colors-purple-700: #7e22ce;
--colors-purple-800: #6b21a8;
--colors-purple-900: #581c87;
--colors-purple-950: #3b0764;
--colors-fuchsia-50: #fdf4ff;
--colors-fuchsia-100: #fae8ff;
--colors-fuchsia-200: #f5d0fe;
--colors-fuchsia-300: #f0abfc;
--colors-fuchsia-400: #e879f9;
--colors-fuchsia-500: #d946ef;
--colors-fuchsia-600: #c026d3;
--colors-fuchsia-700: #a21caf;
--colors-fuchsia-800: #86198f;
--colors-fuchsia-900: #701a75;
--colors-fuchsia-950: #4a044e;
--colors-pink-50: #fdf2f8;
--colors-pink-100: #fce7f3;
--colors-pink-200: #fbcfe8;
--colors-pink-300: #f9a8d4;
--colors-pink-400: #f472b6;
--colors-pink-500: #ec4899;
--colors-pink-600: #db2777;
--colors-pink-700: #be185d;
--colors-pink-800: #9d174d;
--colors-pink-900: #831843;
--colors-pink-950: #500724;
--colors-rose-50: #fff1f2;
--colors-rose-100: #ffe4e6;
--colors-rose-200: #fecdd3;
--colors-rose-300: #fda4af;
--colors-rose-400: #fb7185;
--colors-rose-500: #f43f5e;
--colors-rose-600: #e11d48;
--colors-rose-700: #be123c;
--colors-rose-800: #9f1239;
--colors-rose-900: #881337;
--colors-rose-950: #4c0519;
/* Animations */
--animate-spin: spin 1s linear infinite;
--animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
--animate-bounce: bounce 1s infinite;
/* Blurs */
--blur: 8px;
--blur-sm: 4px;
--blur-md: 12px;
--blur-lg: 16px;
--blur-xl: 24px;
--blur-2xl: 40px;
--blur-3xl: 64px;
/* Radii */
--radius-none: 0px;
--radius-full: 9999px;
--radius-sm: 0.125rem;
--radius: 0.25rem;
--radius-md: 0.375rem;
--radius-lg: 0.5rem;
--radius-xl: 0.75rem;
--radius-2xl: 1rem;
--radius-3xl: 1.5rem;
/* Shadows */
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
--shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
/* Drop shadows */
--drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
--drop-shadow-sm: 0 1px 1px rgb(0 0 0 / 0.05);
--drop-shadow-md: 0 4px 3px rgb(0 0 0 / 0.07), 0 2px 2px rgb(0 0 0 / 0.06);
--drop-shadow-lg: 0 10px 8px rgb(0 0 0 / 0.04), 0 4px 3px rgb(0 0 0 / 0.1);
--drop-shadow-xl: 0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08);
--drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
/* Spacing */
--spacing-px: 1px;
--spacing-0: 0px;
--spacing-0_5: 0.125rem;
--spacing-1: 0.25rem;
--spacing-1_5: 0.375rem;
--spacing-2: 0.5rem;
--spacing-2_5: 0.625rem;
--spacing-3: 0.75rem;
--spacing-3_5: 0.875rem;
--spacing-4: 1rem;
--spacing-5: 1.25rem;
--spacing-6: 1.5rem;
--spacing-7: 1.75rem;
--spacing-8: 2rem;
--spacing-9: 2.25rem;
--spacing-10: 2.5rem;
--spacing-11: 2.75rem;
--spacing-12: 3rem;
--spacing-14: 3.5rem;
--spacing-16: 4rem;
--spacing-20: 5rem;
--spacing-24: 6rem;
--spacing-28: 7rem;
--spacing-32: 8rem;
--spacing-36: 9rem;
--spacing-40: 10rem;
--spacing-44: 11rem;
--spacing-48: 12rem;
--spacing-52: 13rem;
--spacing-56: 14rem;
--spacing-60: 15rem;
--spacing-64: 16rem;
--spacing-72: 18rem;
--spacing-80: 20rem;
--spacing-96: 24rem;
/* Widths */
--width-3xs: 16rem;
--width-2xs: 18rem;
--width-xs: 20rem;
--width-sm: 24rem;
--width-md: 28rem;
--width-lg: 32rem;
--width-xl: 36rem;
--width-2xl: 42rem;
--width-3xl: 48rem;
--width-4xl: 56rem;
--width-5xl: 64rem;
--width-6xl: 72rem;
--width-7xl: 80rem;
--width-prose: 65ch;
/* Fonts */
--font-family-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-family-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
'Courier New', monospace;
/* Type scale */
--font-size-xs: 0.75rem;
--font-size-xs--line-height: 1rem;
--font-size-sm: 0.875rem;
--font-size-sm--line-height: 1.25rem;
--font-size-base: 1rem;
--font-size-base--line-height: 1.5rem;
--font-size-lg: 1.125rem;
--font-size-lg--line-height: 1.75rem;
--font-size-xl: 1.25rem;
--font-size-xl--line-height: 1.75rem;
--font-size-2xl: 1.5rem;
--font-size-2xl--line-height: 2rem;
--font-size-3xl: 1.875rem;
--font-size-3xl--line-height: 2.25rem;
--font-size-4xl: 2.25rem;
--font-size-4xl--line-height: 2.5rem;
--font-size-5xl: 3rem;
--font-size-5xl--line-height: 1;
--font-size-6xl: 3.75rem;
--font-size-6xl--line-height: 1;
--font-size-7xl: 4.5rem;
--font-size-7xl--line-height: 1;
--font-size-8xl: 6rem;
--font-size-8xl--line-height: 1;
--font-size-9xl: 8rem;
--font-size-9xl--line-height: 1;
/* Letter spacing */
--letter-spacing-tighter: -0.05em;
--letter-spacing-tight: -0.025em;
--letter-spacing-normal: 0em;
--letter-spacing-wide: 0.025em;
--letter-spacing-wider: 0.05em;
--letter-spacing-widest: 0.1em;
/* Line-height */
--line-height-none: 1;
--line-height-tight: 1.25;
--line-height-snug: 1.375;
--line-height-normal: 1.5;
--line-height-relaxed: 1.625;
--line-height-loose: 2;
--line-height-3: 0.75rem;
--line-height-4: 1rem;
--line-height-5: 1.25rem;
--line-height-6: 1.5rem;
--line-height-7: 1.75rem;
--line-height-8: 2rem;
--line-height-9: 2.25rem;
--line-height-10: 2.5rem;
/* Transition timing functions */
--transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
--transition-timing-function-linear: linear;
--transition-timing-function-in: cubic-bezier(0.4, 0, 1, 1);
--transition-timing-function-out: cubic-bezier(0, 0, 0.2, 1);
--transition-timing-function-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}
@CamKem
Copy link

CamKem commented Feb 18, 2024

Thanks for the preview! Looks very interesting so far. Can we get an idea of how you anticipate it will work under the hood?

I’m assuming it will still have a build step to remove unused classes, to avoid bloating?

Will these variables be parsed in js, making it a light css in js framework, just without the need for the js configuration files? I would imagine js is involved to turn it into a usable (shorthand) utility class?

I guess configuration file would still be needed for plugins?

Really keen to see a you take deeper dive into the progress on architectural decisions for v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment