Skip to content

Commit 1509be9

Browse files
committed
Tailwind Upgrade 3.x -> 4.0
Tailwind 4.0 just dropped yesterday so I'm fine waiting on merging this change to see if any issues shake out more generally. The tailwind config file is no longer needed and it uses CSS config. The CLI for tailwind is now a separate package. I followed the upgrade guide/script for this upgrade: https://tailwindcss.com/docs/upgrade-guide
1 parent 50f75ed commit 1509be9

File tree

5 files changed

+1012
-1849
lines changed

5 files changed

+1012
-1849
lines changed

assets/src/input.css

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,46 @@
1-
@tailwind base;
1+
@import 'tailwindcss';
2+
3+
@utility container {
4+
margin-inline: auto;
5+
padding-inline: 1rem;
6+
@media (width >= theme(--breakpoint-sm)) {
7+
padding-inline: 2rem;
8+
}
9+
@media (width >= theme(--breakpoint-lg)) {
10+
padding-inline: 4rem;
11+
}
12+
@media (width >= theme(--breakpoint-xl)) {
13+
padding-inline: 6rem;
14+
}
15+
@media (width >= theme(--breakpoint-2xl)) {
16+
padding-inline: 12rem;
17+
}
18+
}
19+
20+
/*
21+
The default border color has changed to `currentColor` in Tailwind CSS v4,
22+
so we've added these compatibility styles to make sure everything still
23+
looks the same as it did with Tailwind CSS v3.
24+
25+
If we ever want to remove these styles, we need to add an explicit border
26+
color utility to any element that depends on these defaults.
27+
*/
28+
@layer base {
29+
*,
30+
::after,
31+
::before,
32+
::backdrop,
33+
::file-selector-button {
34+
border-color: var(--color-gray-200, currentColor);
35+
}
36+
}
37+
38+
@utility btn {
39+
@apply inline-flex items-center justify-center border align-middle select-none font-medium text-center hover:no-underline focus:no-underline focus:shadow-none text-sm py-2 px-4 shadow-xs hover:shadow-md bg-transparent hover:bg-slate-700 text-slate-700 hover:text-white rounded-sm;
40+
svg {
41+
@apply fill-current w-4 h-4 mr-2;
42+
}
43+
}
244

345
/* https://tailwindcss.com/docs/preflight#extending-preflight */
446
/* https://tailwindcss.com/docs/adding-custom-styles#adding-base-styles */
@@ -37,15 +79,3 @@
3779
@apply mb-4;
3880
}
3981
}
40-
41-
@tailwind components;
42-
@tailwind utilities;
43-
44-
@layer components {
45-
.btn {
46-
@apply inline-flex items-center justify-center border align-middle select-none font-medium text-center hover:no-underline focus:no-underline focus:shadow-none text-sm py-2 px-4 shadow-sm hover:shadow-md bg-transparent hover:bg-slate-700 text-slate-700 hover:text-white rounded;
47-
svg {
48-
@apply fill-current w-4 h-4 mr-2;
49-
}
50-
}
51-
}

0 commit comments

Comments
 (0)