Skip to content

Commit a1e071f

Browse files
authored
Update to Tailwind v4 (#390)
1 parent 86ee014 commit a1e071f

File tree

9 files changed

+734
-1104
lines changed

9 files changed

+734
-1104
lines changed

package-lock.json

Lines changed: 634 additions & 985 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"dependencies": {
1212
"@radix-ui/react-icons": "^1.3.0",
1313
"@tailwindcss/line-clamp": "^0.4.4",
14+
"@tailwindcss/postcss": "^4.1.11",
1415
"@types/node": "22.17.0",
1516
"@types/react": "18.3.23",
1617
"@types/react-dom": "18.3.7",
1718
"algoliasearch": "^5.0.0",
18-
"autoprefixer": "10.4.21",
1919
"classnames": "^2.3.2",
2020
"eslint": "^9.0.0",
2121
"eslint-config-next": "15.4.5",
@@ -25,11 +25,11 @@
2525
"react-dom": "18.3.1",
2626
"react-instantsearch": "^7.13.0",
2727
"react-markdown": "^10.0.0",
28-
"tailwindcss": "3.4.17",
28+
"tailwindcss": "^4.1.11",
2929
"typescript": "5.9.2"
3030
},
3131
"devDependencies": {
3232
"prettier": "^3.0.0",
33-
"prettier-plugin-tailwindcss": "^0.6.0"
33+
"prettier-plugin-tailwindcss": "^0.6.14"
3434
}
3535
}

postcss.config.js

Lines changed: 1 addition & 2 deletions
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
}

src/app/globals.css

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,92 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Flex:wdth,[email protected],100..1000&display=swap');
1+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Flex:wdth,[email protected],100..1000&display=swap')
2+
layer(base);
23

3-
@tailwind base;
4-
@tailwind components;
5-
@tailwind utilities;
4+
@import 'tailwindcss';
5+
6+
/* Custom theme variables for Tailwind v4 */
7+
@theme {
8+
--color-neutral-white: #ffffff;
9+
--color-neutral-n1: #f6f6f6;
10+
--color-neutral-n2: #f1f1f1;
11+
--color-neutral-n3: #e5e5e5;
12+
--color-neutral-n4: #d7d7d7;
13+
--color-neutral-n5: #c2c2c2;
14+
--color-neutral-n6: #adadad;
15+
--color-neutral-n7: #939393;
16+
--color-neutral-n8: #797979;
17+
--color-neutral-n9: #6e6e6e;
18+
--color-neutral-n10: #3f3f3f;
19+
--color-neutral-n11: #292929;
20+
--color-neutral-n12: #141414;
21+
--color-neutral-n13: #111111;
22+
--color-neutral-black: #000000;
23+
24+
--color-plum-p1: #f4e9f1;
25+
--color-plum-p2: #e3d0df;
26+
--color-plum-p3: #d7b3cf;
27+
--color-plum-p4: #8d2676;
28+
--color-plum-p5: #711e5e;
29+
--color-plum-p6: #47133b;
30+
31+
--color-yellow-y1: #fdefd2;
32+
--color-yellow-y2: #f8d077;
33+
--color-yellow-y3: #f3b01c;
34+
--color-yellow-y4: #e7a71b;
35+
36+
--color-red-r1: #fcd6d5;
37+
--color-red-r2: #f15d59;
38+
--color-red-r3: #ee342f;
39+
--color-red-r4: #d62f2a;
40+
41+
--color-green-g1: #e5f3dc;
42+
--color-green-g2: #72c043;
43+
--color-green-g3: #4fb014;
44+
--color-green-g4: #479e12;
45+
46+
--color-accent-a1: #07bfe8;
47+
--color-accent-a2: #074ee8;
48+
--color-accent-a3: #7651e0;
49+
--color-accent-a4: #ee9f73;
50+
51+
--color-discord: #5865f2;
52+
53+
--font-family-display:
54+
'Roboto Flex', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
55+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
56+
--font-family-body:
57+
'Inter', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
58+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
59+
--font-family-mono: monospace;
60+
61+
--font-size-xs: 0.6875rem;
62+
--font-size-sm: 0.875rem;
63+
--font-size-base: 1rem;
64+
--font-size-lg: 1.125rem;
65+
--font-size-xl: 1.25rem;
66+
--font-size-2xl: 2.375rem;
67+
--font-size-3xl: 2.5rem;
68+
--font-size-4xl: 2.625rem;
69+
--font-size-5xl: 2.875rem;
70+
--font-size-6xl: 3.125rem;
71+
--font-size-7xl: 3.5rem;
72+
--font-size-8xl: 3.75rem;
73+
}
74+
75+
/* Custom utilities for font stretch (Roboto Flex variable font) */
76+
@layer utilities {
77+
.stretch-min {
78+
font-stretch: 25%;
79+
}
80+
81+
.stretch-thin {
82+
font-stretch: 75%;
83+
}
84+
85+
.stretch-default {
86+
font-stretch: 100%;
87+
}
88+
89+
.stretch-wide {
90+
font-stretch: 125%;
91+
}
92+
}

src/components/Hit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Hit({ hit }: HitProps) {
1212
console.log('hit', hit);
1313

1414
return (
15-
<div className="rounded-lg border border-neutral-n12 bg-neutral-n11 p-3 shadow">
15+
<div className="rounded-lg border border-neutral-n12 bg-neutral-n11 p-3 shadow-sm">
1616
{isDocsHit(hit) && (
1717
<div className="flex flex-col">
1818
<a
@@ -76,7 +76,7 @@ export default function Hit({ hit }: HitProps) {
7676
{hit.messages.slice(0, 3).map((message, index) => (
7777
<li
7878
key={index}
79-
className="flex items-start gap-3 [&:not(:last-of-type)]:mb-2"
79+
className="flex items-start gap-3 not-last-of-type:mb-2"
8080
>
8181
{/* Uses a fallback image, if the avatar we indexed is no longer available. */}
8282
<ImageWithFallback

src/components/Markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function Markdown({ text }: MarkdownProps) {
1010
components={{
1111
p: ({ children }) => <p className="mb-2 text-neutral-n5">{children}</p>,
1212
pre: ({ children }) => (
13-
<div className="mb-4 max-h-72 w-full overflow-x-auto rounded bg-neutral-n12 p-2">
13+
<div className="mb-4 max-h-72 w-full overflow-x-auto rounded-sm bg-neutral-n12 p-2">
1414
<pre className="text-neutral-n5">{children}</pre>
1515
</div>
1616
),

src/components/Results.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function Results() {
4949
<div key={name}>
5050
<a
5151
href={link}
52-
className="hidden bg-neutral-n12 py-4 font-display text-xl font-bold leading-none text-neutral-n2 underline-offset-4 shadow-lg stretch-max hover:underline lg:block"
52+
className="hidden bg-neutral-n12 py-4 font-display text-xl font-bold leading-none text-neutral-n2 underline-offset-4 shadow-lg stretch-wide hover:underline lg:block"
5353
target="_blank"
5454
>
5555
{title}

src/components/SearchBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function SearchBox({
3434
<input
3535
type="text"
3636
placeholder="Search across Docs, Stack, and Discord..."
37-
className="w-full rounded p-2 outline-none md:text-lg"
37+
className="w-full bg-white rounded-sm p-2 outline-hidden md:text-lg"
3838
value={value}
3939
onChange={onChange}
4040
ref={inputRef}

tailwind.config.js

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

0 commit comments

Comments
 (0)