Skip to content

Commit 2c86416

Browse files
feat: migrate from tailwind_v3 to tailwind_v4
1 parent fd99bfa commit 2c86416

File tree

7 files changed

+44
-39
lines changed

7 files changed

+44
-39
lines changed

components/PostListItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const PostListItem: React.FC<PostListItemProps> = ({
2929
readonly
3030
source={featuredImg}
3131
alt="Blog article featured image"
32-
imageClassName="aspect-video object-cover rounded-sm"
32+
imageClassName="aspect-video object-cover rounded-xs"
3333
/>
3434

3535
{/* justify-between */}

components/errorNoKeys.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ const ErrorNoKeys = () => {
55
Warning: missing App credentials
66
</h1>
77
<p className="mb-6">
8-
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded">
8+
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded-sm">
99
NEXT_PUBLIC_APP_ID
1010
</code>{' '}
1111
and{' '}
12-
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded">
12+
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded-sm">
1313
API_KEY
1414
</code>{' '}
1515
are not configured in your{' '}
16-
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded">
16+
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded-sm">
1717
.env.local
1818
</code>{' '}
1919
file.
2020
</p>
2121
<p className="mb-2">
2222
Please create a{' '}
23-
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded">
23+
<code className="text-sm text-black bg-gray-100 px-1 py-1 rounded-sm">
2424
.env.local
2525
</code>{' '}
2626
file with:
2727
</p>
28-
<pre className="bg-gray-900 text-white px-4 py-3 rounded">
28+
<pre className="bg-gray-900 text-white px-4 py-3 rounded-sm">
2929
{`NEXT_PUBLIC_APP_ID=...
3030
API_KEY=...`}
3131
</pre>

css/styles.css

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
3+
@plugin '@tailwindcss/forms';
4+
5+
@custom-variant dark (&:is(.dark *));
6+
7+
@theme {
8+
--font-sans: var(--font-nunito);
9+
10+
--breakpoint-sm: 600px;
11+
--breakpoint-lg: 900px;
12+
--breakpoint-xl: 1200px;
13+
14+
--shadow-news-letter: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
15+
0 5px 15px 0 rgba(0, 0, 0, 0.05);
16+
}
17+
18+
/*
19+
The default border color has changed to `currentColor` in Tailwind CSS v4,
20+
so we've added these compatibility styles to make sure everything still
21+
looks the same as it did with Tailwind CSS v3.
22+
23+
If we ever want to remove these styles, we need to add an explicit border
24+
color utility to any element that depends on these defaults.
25+
*/
26+
@layer base {
27+
*,
28+
::after,
29+
::before,
30+
::backdrop,
31+
::file-selector-button {
32+
border-color: var(--color-gray-200, currentColor);
33+
}
34+
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
},
2828
"devDependencies": {
2929
"@tailwindcss/forms": "^0.5.7",
30+
"@tailwindcss/postcss": "^4.0.12",
3031
"@types/jsonp": "^0.2.3",
3132
"@types/node": "^22.0.0",
3233
"@types/prismjs": "^1.26.4",
3334
"@types/react": "^18.3.3",
3435
"@types/react-slick": "^0.23.13",
35-
"autoprefixer": "^10.4.19",
3636
"postcss": "^8.4.40",
37-
"tailwindcss": "^3.4.7",
37+
"tailwindcss": "^4.0.12",
3838
"typescript": "^5.5.4"
3939
},
4040
"prettier": {

postcss.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
3+
'@tailwindcss/postcss': {},
54
},
65
}

react-bricks/bricks/custom/MyHeroUnit.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const MyHeroUnit: types.Brick<HeroUnitProps> = ({ padding }) => {
5454
types.RichTextFeatures.Link,
5555
]}
5656
renderCode={(props) => (
57-
<code className="text-sm py-1 px-2 bg-gray-200 dark:bg-gray-700 rounded">
57+
<code className="text-sm py-1 px-2 bg-gray-200 dark:bg-gray-700 rounded-sm">
5858
{props.children}
5959
</code>
6060
)}

tailwind.config.js

-25
This file was deleted.

0 commit comments

Comments
 (0)