Skip to content

Commit 03d4c98

Browse files
reininkdanhollickRobinMalfaitadamwathan
authored
Tailwind CSS v4.1 documentation and blog post (#2189)
Co-authored-by: Dan Hollick <[email protected]> Co-authored-by: Daniel Hollick <[email protected]> Co-authored-by: Robin Malfait <[email protected]> Co-authored-by: Adam Wathan <[email protected]>
1 parent 7a6a9ce commit 03d4c98

File tree

113 files changed

+4437
-674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+4437
-674
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@heroicons/react": "^2.2.0",
1616
"@next/mdx": "15.3.0-canary.23",
1717
"@shikijs/transformers": "^1.29.1",
18-
"@tailwindcss/postcss": "^4.1.1",
18+
"@tailwindcss/postcss": "4.1.1",
1919
"@types/mdx": "^2.0.13",
2020
"clsx": "^2.1.1",
2121
"dedent": "^1.5.3",
@@ -28,11 +28,11 @@
2828
"react": "^19.0.0",
2929
"react-dom": "^19.0.0",
3030
"shiki": "^1.29.1",
31-
"tailwindcss": "^4.1.1"
31+
"tailwindcss": "4.1.1"
3232
},
3333
"devDependencies": {
3434
"@svgr/webpack": "^8.1.0",
35-
"@tailwindcss/node": "^4.1.1",
35+
"@tailwindcss/node": "4.1.1",
3636
"@types/hast": "^3.0.4",
3737
"@types/node": "^22.13.13",
3838
"@types/react": "^19.0.12",

pnpm-lock.yaml

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

public/og-background.jpg

-4.26 KB
Loading

src/app/(docs)/docs/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export default {
104104
["vertical-align", "/docs/vertical-align"],
105105
["white-space", "/docs/white-space"],
106106
["word-break", "/docs/word-break"],
107+
["overflow-wrap", "/docs/overflow-wrap"],
107108
["hyphens", "/docs/hyphens"],
108109
["content", "/docs/content"],
109110
] as const,
@@ -129,9 +130,19 @@ export default {
129130
] as const,
130131
Effects: [
131132
["box-shadow", "/docs/box-shadow"],
133+
["text-shadow", "/docs/text-shadow"],
132134
["opacity", "/docs/opacity"],
133135
["mix-blend-mode", "/docs/mix-blend-mode"],
134136
["background-blend-mode", "/docs/background-blend-mode"],
137+
["mask-clip", "/docs/mask-clip"],
138+
["mask-composite", "/docs/mask-composite"],
139+
["mask-image", "/docs/mask-image"],
140+
["mask-mode", "/docs/mask-mode"],
141+
["mask-origin", "/docs/mask-origin"],
142+
["mask-position", "/docs/mask-position"],
143+
["mask-repeat", "/docs/mask-repeat"],
144+
["mask-size", "/docs/mask-size"],
145+
["mask-type", "/docs/mask-type"],
135146
] as const,
136147
Filters: [
137148
[

src/app/opengraph-image.jpg

-12.5 KB
Loading

src/blog/tailwindcss-v3/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,23 @@ After about five false starts, we finally figured out an approach we liked, and
119119
{
120120
<div className="flex flex-col justify-center gap-8 sm:flex-row sm:gap-16">
121121
<div className="flex shrink-0 flex-col items-center">
122-
<p className="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400">
122+
<p className="mb-3 text-center font-mono text-xs font-medium text-gray-500 dark:text-gray-400">
123123
<>shadow-cyan-500/50</>
124124
</p>
125125
<button className="rounded-md bg-cyan-500 px-3 py-2 text-sm font-semibold text-white shadow-lg shadow-cyan-500/50 focus:outline-none">
126126
<>Subscribe</>
127127
</button>
128128
</div>
129129
<div className="flex shrink-0 flex-col items-center">
130-
<p className="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400">
130+
<p className="mb-3 text-center font-mono text-xs font-medium text-gray-500 dark:text-gray-400">
131131
<>shadow-blue-500/50</>
132132
</p>
133133
<button className="rounded-md bg-blue-500 px-3 py-2 text-sm font-semibold text-white shadow-lg shadow-blue-500/50 focus:outline-none">
134134
<>Subscribe</>
135135
</button>
136136
</div>
137137
<div className="flex shrink-0 flex-col items-center">
138-
<p className="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400">
138+
<p className="mb-3 text-center font-mono text-xs font-medium text-gray-500 dark:text-gray-400">
139139
<>shadow-indigo-500/50</>
140140
</p>
141141
<button className="rounded-md bg-indigo-500 px-3 py-2 text-sm font-semibold text-white shadow-lg shadow-indigo-500/50 focus:outline-none">

src/blog/tailwindcss-v4-1/card.jpg

1.17 MB
Loading

src/blog/tailwindcss-v4-1/index.mdx

Lines changed: 869 additions & 0 deletions
Large diffs are not rendered by default.
300 KB
Loading
254 KB
Loading

src/blog/tailwindcss-v4-1/mask.png

46.5 KB
Loading
593 KB
Loading
470 KB
Loading

src/components/code-example.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export function CodeExampleWrapper({ className, children }: { className?: string
7474
export function CodeExampleStack({ children }: { children: React.ReactNode }) {
7575
return (
7676
<div data-stack>
77-
<div className="not-prose rounded-xl dark:outline dark:-outline-offset-1 dark:outline-white/10">{children}</div>
77+
<div className="not-prose rounded-xl in-[figure]:mt-1 in-[figure]:rounded-b-lg in-[figure]:px-0.5 in-[figure]:pb-0.5 dark:outline dark:-outline-offset-1 dark:outline-white/10 dark:in-[figure]:outline-1 dark:in-[figure]:outline-offset-1">
78+
{children}
79+
</div>
7880
</div>
7981
);
8082
}

src/components/content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function htmlSnippet({
3737
parts.push("></iframe>");
3838
} else {
3939
parts.push(">\n");
40-
parts.push(" <!-- ... -->\n");
40+
parts.push(elementName === "p" ? " Lorem ipsum dolor sit amet...\n" : " <!-- ... -->\n");
4141
parts.push(`</${elementName}>`);
4242
}
4343

src/components/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function VersionPicker() {
5454
className="flex items-center gap-0.5 rounded-2xl bg-gray-950/5 py-0.5 pr-1.5 pl-2.5 text-xs/5 font-medium text-gray-950 tabular-nums hover:bg-gray-950/7.5 data-active:bg-gray-950/7.5 dark:bg-white/10 dark:text-white dark:hover:bg-white/12.5 dark:data-active:bg-white/12.5"
5555
aria-label="Select version of library"
5656
>
57-
v4.0
57+
v4.1
5858
<ChevronDownIcon className="size-4 fill-gray-400" />
5959
</MenuButton>
6060
<MenuItems
@@ -63,7 +63,7 @@ function VersionPicker() {
6363
>
6464
<MenuItem disabled>
6565
<div className="flex items-center justify-between gap-2 rounded-lg px-2.5 data-active:bg-gray-950/5 dark:data-active:bg-white/10">
66-
v4.0
66+
v4.1
6767
<CheckIcon className="size-4" />
6868
</div>
6969
</MenuItem>

src/components/stripes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function Stripes({
1616
border === "x" && "border-x",
1717
border === "y" && "border-y",
1818
noColor === false && "text-black/10 dark:text-white/12.5",
19-
"bg-[size:8px_8px] bg-left-top",
19+
"bg-[size:8px_8px] bg-top-left",
2020
"bg-[image:repeating-linear-gradient(315deg,currentColor_0,currentColor_1px,transparent_0,transparent_50%)]",
2121
)}
2222
>

src/docs/align-items.mdx

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export const description =
1212
rows={[
1313
["items-start", "align-items: flex-start;"],
1414
["items-end", "align-items: flex-end;"],
15+
["items-end-safe", "align-items: safe flex-end;"],
1516
["items-center", "align-items: center;"],
17+
["items-center-safe", "align-items: safe center;"],
1618
["items-baseline", "align-items: baseline;"],
19+
["items-baseline-last", "align-items: last baseline;"],
1720
["items-stretch", "align-items: stretch;"],
1821
]}
1922
/>
@@ -22,7 +25,7 @@ export const description =
2225

2326
### Stretch
2427

25-
Use `items-stretch` to stretch items to fill the container's cross axis:
28+
Use the `items-stretch` utility to stretch items to fill the container's cross axis:
2629

2730
<Figure>
2831

@@ -52,7 +55,7 @@ Use `items-stretch` to stretch items to fill the container's cross axis:
5255

5356
### Start
5457

55-
Use `items-start` to align items to the start of the container's cross axis:
58+
Use the `items-start` utility to align items to the start of the container's cross axis:
5659

5760
<Figure>
5861

@@ -82,7 +85,7 @@ Use `items-start` to align items to the start of the container's cross axis:
8285

8386
### Center
8487

85-
Use `items-center` to align items along the center of the container's cross axis:
88+
Use the `items-center` utility to align items along the center of the container's cross axis:
8689

8790
<Figure>
8891

@@ -112,7 +115,7 @@ Use `items-center` to align items along the center of the container's cross axis
112115

113116
### End
114117

115-
Use `items-end` to align items to the end of the container's cross axis:
118+
Use the `items-end` utility to align items to the end of the container's cross axis:
116119

117120
<Figure>
118121

@@ -142,7 +145,7 @@ Use `items-end` to align items to the end of the container's cross axis:
142145

143146
### Baseline
144147

145-
Use `items-baseline` to align items along the container's cross axis such that all of their baselines align:
148+
Use the `items-baseline` utility to align items along the container's cross axis such that all of their baselines align:
146149

147150
<Figure>
148151

@@ -170,6 +173,69 @@ Use `items-baseline` to align items along the container's cross axis such that a
170173

171174
</Figure>
172175

176+
### Last baseline
177+
178+
Use the `items-baseline-last` utility to align items along the container's cross axis such that all of their baselines align with the last baseline in the container:
179+
180+
<Figure>
181+
182+
<Example padding={false}>
183+
{
184+
<div className="mx-auto grid max-w-md divide-y divide-gray-100 border-x border-x-gray-200 text-gray-700 dark:divide-gray-800 dark:border-x-gray-800 dark:bg-gray-950/10 dark:text-gray-300">
185+
<div className="grid grid-cols-[1fr_auto] items-baseline-last gap-x-4 px-4 py-6">
186+
<div className="grid grid-cols-[auto_1fr] gap-x-4 max-sm:grid-cols-1">
187+
<img
188+
className="size-[2rem] rounded-full"
189+
src="https://spotlight.tailwindui.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Favatar.51a13c67.jpg&w=128&q=80"
190+
alt=""
191+
/>
192+
<div className="font-semibold text-gray-900 sm:col-start-2 dark:text-white">Spencer Sharp</div>
193+
<p className="text-sm sm:col-start-2">Working on the future of astronaut recruitment at Space Recruit.</p>
194+
</div>
195+
<a
196+
href="#"
197+
className="font-mono text-xs font-medium text-gray-400 underline hover:text-blue-500 dark:text-gray-500"
198+
>
199+
spacerecruit.com
200+
</a>
201+
</div>
202+
<div className="grid grid-cols-[1fr_auto] items-baseline-last gap-x-4 px-4 py-6">
203+
<div className="grid grid-cols-[auto_1fr] gap-x-4 max-sm:grid-cols-1">
204+
<img
205+
className="size-[2rem] rounded-full"
206+
src="https://images.unsplash.com/photo-1590895340509-793cb98788c9?q=80&w=256&h=256&&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
207+
alt=""
208+
/>
209+
<div className="font-semibold text-gray-900 sm:col-start-2 dark:text-white">Alex Reed</div>
210+
<p className="text-sm sm:col-start-2">A multidisciplinary designer.</p>
211+
</div>
212+
<a
213+
href="#"
214+
className="font-mono text-xs font-medium text-gray-400 underline hover:text-blue-500 dark:text-gray-500"
215+
>
216+
alex-reed.com
217+
</a>
218+
</div>
219+
</div>
220+
}
221+
</Example>
222+
223+
```html
224+
<!-- [!code classes:items-baseline-last] -->
225+
<div class="grid grid-cols-[1fr_auto] items-baseline-last">
226+
<div>
227+
<img src="img/spencer-sharp.jpg" />
228+
<h4>Spencer Sharp</h4>
229+
<p>Working on the future of astronaut recruitment at Space Recruit.</p>
230+
</div>
231+
<p>spacerecruit.com</p>
232+
</div>
233+
```
234+
235+
</Figure>
236+
237+
This is useful for ensuring that text items align with each other, even if they have different heights.
238+
173239
### Responsive design
174240

175241
<ResponsiveDesign property="align-items" defaultClass="flex items-stretch" featuredClass="items-center" />

0 commit comments

Comments
 (0)