|
| 1 | +const TAILWIND_V4_COLOR_STEPS = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'] as const |
| 2 | + |
| 3 | +const TAILWIND_V4_COLOR_PALETTE: Record<string, string[]> = { |
| 4 | + slate: ['#f8fafc', '#f1f5f9', '#e2e8f0', '#cad5e2', '#90a1b9', '#62748e', '#45556c', '#314158', '#1d293d', '#0f172b', '#020618'], |
| 5 | + gray: ['#f9fafb', '#f3f4f6', '#e5e7eb', '#d1d5dc', '#99a1af', '#6a7282', '#4a5565', '#364153', '#1e2939', '#101828', '#030712'], |
| 6 | + zinc: ['#fafafa', '#f4f4f5', '#e4e4e7', '#d4d4d8', '#9f9fa9', '#71717b', '#52525c', '#3f3f46', '#27272a', '#18181b', '#09090b'], |
| 7 | + neutral: ['#fafafa', '#f5f5f5', '#e5e5e5', '#d4d4d4', '#a1a1a1', '#737373', '#525252', '#404040', '#262626', '#171717', '#0a0a0a'], |
| 8 | + stone: ['#fafaf9', '#f5f5f4', '#e7e5e4', '#d6d3d1', '#a6a09b', '#79716b', '#57534d', '#44403b', '#292524', '#1c1917', '#0c0a09'], |
| 9 | + mauve: ['#fafafa', '#f3f1f3', '#e7e4e7', '#d7d0d7', '#a89ea9', '#79697b', '#594c5b', '#463947', '#2a212c', '#1d161e', '#0c090c'], |
| 10 | + olive: ['#fbfbf9', '#f4f4f0', '#e8e8e3', '#d8d8d0', '#abab9c', '#7c7c67', '#5b5b4b', '#474739', '#2b2b22', '#1d1d16', '#0c0c09'], |
| 11 | + mist: ['#f9fbfb', '#f1f3f3', '#e3e7e8', '#d0d6d8', '#9ca8ab', '#67787c', '#4b585b', '#394447', '#22292b', '#161b1d', '#090b0c'], |
| 12 | + taupe: ['#fbfaf9', '#f3f1f1', '#e8e4e3', '#d8d2d0', '#aba09c', '#7c6d67', '#5b4f4b', '#473c39', '#2b2422', '#1d1816', '#0c0a09'], |
| 13 | + red: ['#fef2f2', '#ffe2e2', '#ffc9c9', '#ffa2a2', '#ff6467', '#fb2c36', '#e7000b', '#c10007', '#9f0712', '#82181a', '#460809'], |
| 14 | + orange: ['#fff7ed', '#ffedd4', '#ffd6a7', '#ffb86a', '#ff8904', '#ff6900', '#f54900', '#ca3500', '#9f2d00', '#7e2a0c', '#441306'], |
| 15 | + amber: ['#fffbeb', '#fef3c6', '#fee685', '#ffd230', '#ffb900', '#fe9a00', '#e17100', '#bb4d00', '#973c00', '#7b3306', '#461901'], |
| 16 | + yellow: ['#fefce8', '#fef9c2', '#fff085', '#ffdf20', '#fdc700', '#f0b100', '#d08700', '#a65f00', '#894b00', '#733e0a', '#432004'], |
| 17 | + lime: ['#f7fee7', '#ecfcca', '#d8f999', '#bbf451', '#9ae600', '#7ccf00', '#5ea500', '#497d00', '#3c6300', '#35530e', '#192e03'], |
| 18 | + green: ['#f0fdf4', '#dcfce7', '#b9f8cf', '#7bf1a8', '#05df72', '#00c950', '#00a63e', '#008236', '#016630', '#0d542b', '#032e15'], |
| 19 | + emerald: ['#ecfdf5', '#d0fae5', '#a4f4cf', '#5ee9b5', '#00d492', '#00bc7d', '#009966', '#007a55', '#006045', '#004f3b', '#002c22'], |
| 20 | + teal: ['#f0fdfa', '#cbfbf1', '#96f7e4', '#46ecd5', '#00d5be', '#00bba7', '#009689', '#00786f', '#005f5a', '#0b4f4a', '#022f2e'], |
| 21 | + cyan: ['#ecfeff', '#cefafe', '#a2f4fd', '#53eafd', '#00d3f2', '#00b8db', '#0092b8', '#007595', '#005f78', '#104e64', '#053345'], |
| 22 | + sky: ['#f0f9ff', '#dff2fe', '#b8e6fe', '#74d4ff', '#00bcff', '#00a6f4', '#0084d1', '#0069a8', '#00598a', '#024a70', '#052f4a'], |
| 23 | + blue: ['#eff6ff', '#dbeafe', '#bedbff', '#8ec5ff', '#51a2ff', '#2b7fff', '#155dfc', '#1447e6', '#193cb8', '#1c398e', '#162456'], |
| 24 | + indigo: ['#eef2ff', '#e0e7ff', '#c6d2ff', '#a3b3ff', '#7c86ff', '#615fff', '#4f39f6', '#432dd7', '#372aac', '#312c85', '#1e1a4d'], |
| 25 | + violet: ['#f5f3ff', '#ede9fe', '#ddd6ff', '#c4b4ff', '#a684ff', '#8e51ff', '#7f22fe', '#7008e7', '#5d0ec0', '#4d179a', '#2f0d68'], |
| 26 | + purple: ['#faf5ff', '#f3e8ff', '#e9d4ff', '#dab2ff', '#c27aff', '#ad46ff', '#9810fa', '#8200db', '#6e11b0', '#59168b', '#3c0366'], |
| 27 | + fuchsia: ['#fdf4ff', '#fae8ff', '#f6cfff', '#f4a8ff', '#ed6aff', '#e12afb', '#c800de', '#a800b7', '#8a0194', '#721378', '#4b004f'], |
| 28 | + pink: ['#fdf2f8', '#fce7f3', '#fccee8', '#fda5d5', '#fb64b6', '#f6339a', '#e60076', '#c6005c', '#a3004c', '#861043', '#510424'], |
| 29 | + rose: ['#fff1f2', '#ffe4e6', '#ffccd3', '#ffa1ad', '#ff637e', '#ff2056', '#ec003f', '#c70036', '#a50036', '#8b0836', '#4d0218'], |
| 30 | +} |
| 31 | + |
| 32 | +export function createTailwindV4DefaultColorThemeCss() { |
| 33 | + const declarations = [ |
| 34 | + ' --color-black: #000;', |
| 35 | + ' --color-white: #fff;', |
| 36 | + ] |
| 37 | + for (const [color, values] of Object.entries(TAILWIND_V4_COLOR_PALETTE)) { |
| 38 | + for (let index = 0; index < TAILWIND_V4_COLOR_STEPS.length; index++) { |
| 39 | + declarations.push(` --color-${color}-${TAILWIND_V4_COLOR_STEPS[index]}: ${values[index]};`) |
| 40 | + } |
| 41 | + } |
| 42 | + return [ |
| 43 | + '@theme {', |
| 44 | + ...declarations, |
| 45 | + '}', |
| 46 | + ].join('\n') |
| 47 | +} |
0 commit comments