Skip to content

Commit 2ec3fe8

Browse files
committed
chore(tailwindcss): migrate to v4 CSS-first configuration #439
1 parent 694d52c commit 2ec3fe8

File tree

4 files changed

+61
-142
lines changed

4 files changed

+61
-142
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
"url": "github:atlas-bi/website"
6060
},
6161
"scripts": {
62-
"build": "ELEVENTY_PRODUCTION=true eleventy && NODE_ENV=production npx @tailwindcss/cli -i src/static/styles/global.css -c tailwind.config.js -o _site/static/css/style.css --minify && npm run updateSearch",
63-
"build:ci": "ELEVENTY_PRODUCTION=true eleventy && NODE_ENV=production npx @tailwindcss/cli -i src/static/styles/global.css -c tailwind.config.js -o _site/static/css/style.css --minify",
62+
"build": "ELEVENTY_PRODUCTION=true eleventy && NODE_ENV=production tailwindcss -i src/static/styles/global.css -o _site/static/css/style.css --minify && npm run updateSearch",
63+
"build:ci": "ELEVENTY_PRODUCTION=true eleventy && NODE_ENV=production tailwindcss -i src/static/styles/global.css -o _site/static/css/style.css --minify",
6464
"start": "run-p 11ty:start tailwind:process",
6565
"11ty:start": "ELEVENTY_PRODUCTION=true eleventy --serve --watch",
6666
"updateSearch": "dotenv node ./src/search/update-algolia-index.js",
@@ -72,7 +72,7 @@
7272
"format:prettier": "prettier --config .prettierrc \"src/**/*.{ts,css,less,scss,js,json,md,yaml,html}\" --write",
7373
"format:djlint": "djlint src -e njk --reformat --quiet --warn",
7474
"commit": "git add . && npm run pre-commit && cz --no-verify",
75-
"tailwind:process": "npx @tailwindcss/cli -i src/static/styles/global.css -c tailwind.config.js -o _site/static/css/style.css --watch"
75+
"tailwind:process": "tailwindcss -i src/static/styles/global.css -o _site/static/css/style.css --watch"
7676
},
7777
"lint-staged": {
7878
"src/**/*.{ts,css,less,scss,js,json,md,yaml,html}": [

src/safelist.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!-- Safelist classes to ensure they are generated by Tailwind -->
2+
<div class="w-4 h-4 w-5 h-5 mt-8 rounded rounded-lg text-3xl sm:text-4xl font-extrabold text-slate-900 tracking-tight dark:text-slate-200 group flex whitespace-pre-wrap -ml-4 pl-4 absolute -ml-7 items-center opacity-0 border-0 group-hover:opacity-100 text-blue-400 hover:text-blue-800 transition-colors no-underline bg-slate-200 py-1 -my-1 border-b hover:text-slate-900 dark:hover:text-slate-400 text-sky-500 hover:text-sky-600 overflow-hidden relative w-full border p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 bg-background text-foreground mb-1 font-medium leading-none text-sm [&_p]:leading-relaxed mt-0 bg-slate-900/80"></div>

src/static/styles/global.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,63 @@
11
@import "tailwindcss";
2+
3+
/* stylelint-disable at-rule-no-unknown */
24
@plugin "@tailwindcss/typography";
35
@plugin "tailwindcss-animate";
46
@plugin "tailwindcss-animated";
7+
@source "../../**/*.{html,njk,md,svg,js}";
8+
9+
@theme {
10+
11+
--color-border: hsl(var(--border));
12+
--color-input: hsl(var(--input));
13+
--color-ring: hsl(var(--ring));
14+
--color-background: hsl(var(--background));
15+
--color-foreground: hsl(var(--foreground));
16+
17+
--color-primary: hsl(var(--primary));
18+
--color-primary-foreground: hsl(var(--primary-foreground));
19+
20+
--color-secondary: hsl(var(--secondary));
21+
--color-secondary-foreground: hsl(var(--secondary-foreground));
22+
23+
--color-destructive: hsl(var(--destructive));
24+
--color-destructive-foreground: hsl(var(--destructive-foreground));
25+
26+
--color-muted: hsl(var(--muted));
27+
--color-muted-foreground: hsl(var(--muted-foreground));
28+
29+
--color-accent: hsl(var(--accent));
30+
--color-accent-foreground: hsl(var(--accent-foreground));
31+
32+
--color-popover: hsl(var(--popover));
33+
--color-popover-foreground: hsl(var(--popover-foreground));
34+
35+
--color-card: hsl(var(--card));
36+
--color-card-foreground: hsl(var(--card-foreground));
37+
38+
--radius-lg: var(--radius);
39+
--radius-md: calc(var(--radius) - 2px);
40+
--radius-sm: calc(var(--radius) - 4px);
41+
42+
--animate-accordion-down: accordion-down 0.2s ease-out;
43+
--animate-accordion-up: accordion-up 0.2s ease-out;
44+
45+
@keyframes accordion-down {
46+
from { height: 0; }
47+
to { height: var(--radix-accordion-content-height); }
48+
}
49+
@keyframes accordion-up {
50+
from { height: var(--radix-accordion-content-height); }
51+
to { height: 0; }
52+
}
53+
}
54+
55+
@utility container {
56+
margin-inline: auto;
57+
padding-inline: 2rem;
58+
}
59+
60+
/* stylelint-enable at-rule-no-unknown */
561

662
@layer base {
763
:root {

tailwind.config.js

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)