Skip to content

Commit 802d5d7

Browse files
authored
Clean up blog posts (#2209)
This PR does a bunch of cleanup to the blog posts — issues that were largely introduced during the v3 to v4 migration, including: - Adding more consistent media styles for video, image, and iframe styles - Add `<ol>` styles - Moving the first video/image to the top of the blog posts (where appropriate) - Making heading casing more consistent - Fixing various formatting issues
1 parent 5339333 commit 802d5d7

File tree

72 files changed

+366
-630
lines changed

Some content is hidden

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

72 files changed

+366
-630
lines changed

src/app/typography.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,24 @@
9595
}
9696
}
9797

98+
ol:where(:not(.not-prose, .not-prose *)) {
99+
padding-left: calc(var(--spacing) * 6);
100+
list-style-type: decimal;
101+
}
102+
103+
ol li:where(:not(.not-prose, .not-prose *)) {
104+
padding-left: calc(var(--spacing) * 3);
105+
}
106+
107+
ol li + li:where(:not(.not-prose, .not-prose *)) {
108+
margin-top: calc(var(--spacing) * 4);
109+
}
110+
111+
ol li:where(:not(.not-prose, .not-prose *))::marker {
112+
font-weight: 600;
113+
color: var(--prose-strong-color);
114+
}
115+
98116
ul:where(:not(.not-prose, .not-prose *)) {
99117
padding-left: calc(var(--spacing) * 6);
100118
list-style-type: square;
@@ -128,6 +146,10 @@
128146
text-decoration-thickness: 2px;
129147
}
130148

149+
a:where(:not(.not-prose, .not-prose *)):has(> [data-media]) {
150+
display: block;
151+
}
152+
131153
strong:where(:not(.not-prose, .not-prose *)) {
132154
color: var(--prose-strong-color);
133155
font-weight: var(--font-weight-semibold);

src/blog/2022-05-23-headless-ui-v1-6-tailwind-ui-team-management/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { adamwathan } from "@/app/blog/authors";
22
import card from "./card.jpg";
33
import { Figure } from "@/components/figure.tsx";
44
import { Example } from "@/components/example.tsx";
5-
import Image from "next/image";
5+
import { Image } from "@/components/media";
66
import Link from "next/link";
77
import teamManagement from "./team-management.png";
88
import playGeneratedCss from "./play-generated-css.png";

src/blog/2022-06-23-tailwind-templates-and-all-access/index.mdx

Lines changed: 23 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import card from "./card.jpg";
33
import allAccess from "./all-access.jpg";
44
import codeStructure from "./code-structure.jpg";
55
import templates from "./templates.jpg";
6-
import Image from "next/image";
6+
import { Image } from "@/components/media";
77
import Link from "next/link";
88

99
export const meta = {
@@ -21,41 +21,21 @@ export const meta = {
2121
),
2222
};
2323

24-
When I was early in my programming career, I loved following{" "}
25-
26-
<Link href="https://thoughtbot.com/">thoughtbot</Link>. They were always writing interesting programming articles,
27-
producing fantastic screencasts, and publishing incredible books. I could tell they really cared about their craft and
28-
it inspired the hell out of me.
29-
30-
But when they launched{" "}
31-
32-
<Link href="https://thoughtbot.com/upcase">Upcase</Link>, the thing I was most excited about wasn't the courses or
33-
weekly videos. What I was most excited about was the source code for Upcase itself — the _actual-in-production_ Rails
34-
codebase that they gave you access to when you subscribed.
24+
<Image alt="Tailwind CSS Templates" src={templates} />
3525

36-
I'd learned a ton from blog posts, books, and screencasts, but I still craved
37-
the chance to dig into a real-world codebase crafted by people I trust and
38-
study how they put all that knowledge together to build a production-ready
39-
application.
26+
When I was early in my programming career, I loved following <Link href="https://thoughtbot.com/">thoughtbot</Link>. They were always writing interesting programming articles, producing fantastic screencasts, and publishing incredible books. I could tell they really cared about their craft and it inspired the hell out of me.
4027

41-
That experience was transformative for me, and so for a long time I've wanted
42-
to give people something like it to learn how real websites are built with
43-
Tailwind CSS.
28+
But when they launched <Link href="https://thoughtbot.com/upcase">Upcase</Link>, the thing I was most excited about wasn't the courses or weekly videos. What I was most excited about was the source code for Upcase itself — the _actual-in-production_ Rails codebase that they gave you access to when you subscribed.
4429

45-
How a layout is broken down into components, what sort of APIs those
46-
components expose, how the config has been customized — all of the interesting
47-
decisions that you can't see when you just click _view source_ in the browser.
30+
I'd learned a ton from blog posts, books, and screencasts, but I still craved the chance to dig into a real-world codebase crafted by people I trust and study how they put all that knowledge together to build a production-ready application.
4831

49-
So today we're releasing our first batch of official Tailwind CSS{" "}
32+
That experience was transformative for me, and so for a long time I've wanted to give people something like it to learn how real websites are built with Tailwind CSS.
5033

51-
<Link href="https://tailwindui.com/templates">website templates</Link> — beautiful designs engineered into
52-
production-quality codebases, powered by Tailwind CSS and Next.js.
34+
How a layout is broken down into components, what sort of APIs those components expose, how the config has been customized — all of the interesting decisions that you can't see when you just click _view source_ in the browser.
5335

54-
<Image alt="Tailwind CSS Templates" src={templates} />
36+
So today we're releasing our first batch of official Tailwind CSS <Link href="https://tailwindui.com/templates">website templates</Link> — beautiful designs engineered into production-quality codebases, powered by Tailwind CSS and Next.js.
5537

56-
We started designing these way back in March and I'm really excited to get
57-
these first five out the door so you can check them out and start playing with
58-
them:
38+
We started designing these way back in March and I'm really excited to get these first five out the door so you can check them out and start playing with them:
5939

6040
- <Link href="https://syntax.tailwindui.com/">Syntax</Link> — a documentation site template powered by Stripe's new <Link href="https://markdoc.io/">
6141
Markdoc
@@ -69,80 +49,43 @@ them:
6949
- <Link href="https://transmit.tailwindui.com/">Transmit</Link> — an awesome podcasting template with a custom
7050
persistent audio player that you can wire up to your own RSS feed in no time.
7151

72-
We've put a ton of time and attention into both the design and the code, and
73-
everything is structured exactly the way we'd do it in a real production
74-
project. They're the perfect starting point when you don't want to start from a
75-
blank canvas, and the best way to learn how experts build modern websites with
76-
Tailwind CSS.
52+
We've put a ton of time and attention into both the design and the code, and everything is structured exactly the way we'd do it in a real production project. They're the perfect starting point when you don't want to start from a blank canvas, and the best way to learn how experts build modern websites with Tailwind CSS.
7753

7854
<Image alt="Code Structure" src={codeStructure} />
7955

80-
Each template can be purchased on its own for **$99**, or you can get all of
81-
them with <Link href="https://tailwindui.com/all-access">all-access</Link> —
82-
the new _get-everything-we-ever-add-forever_ package we're launching today.
56+
Each template can be purchased on its own for **$99**, or you can get all of them with <Link href="https://tailwindui.com/all-access">all-access</Link> — the new _get-everything-we-ever-add-forever_ package we're launching today.
8357

8458
---
8559

8660
## Going all in on all-access
8761

88-
When we started working on templates, one of the things I was really sure about
89-
is that I wanted it to be easy to get access to _all_ of them.
62+
When we started working on templates, one of the things I was really sure about is that I wanted it to be easy to get access to _all_ of them.
9063

9164
This was important to me for two reasons:
9265

93-
1. **I want people to think of our templates more like educational resources
94-
than traditional website themes**. Every template we build has its own
95-
unique learning moments, and I don't want people to have to be selective
96-
about what they get to learn from.
97-
98-
2. **I don't want to worry about ROI on a per-template basis**. Nothing would
99-
suck the fun out of designing and building templates like having to make
100-
sure each one had mass appeal. I want us to have the freedom to make niche,
101-
interesting stuff with cool ideas to study, not just templates that can sell
102-
enough copies on their own to justify the work we put into them.
103-
104-
When I was a kid I went to this{" "}
105-
106-
<Link href="https://en.concerts-metal.com/concert_-_Hellfest_2008-3308.html">music festival</Link> in France where
107-
almost a hundred bands performed. There were a couple of bands on the bill I absolutely _loved_, knew every song, and
108-
would buy a ticket to see any day of the week.
66+
1. **I want people to think of our templates more like educational resources than traditional website themes**. Every template we build has its own unique learning moments, and I don't want people to have to be selective about what they get to learn from.
67+
2. **I don't want to worry about ROI on a per-template basis**. Nothing would suck the fun out of designing and building templates like having to make sure each one had mass appeal. I want us to have the freedom to make niche, interesting stuff with cool ideas to study, not just templates that can sell enough copies on their own to justify the work we put into them.
10968

110-
Most of them though were bands I really _liked_, but wouldn't have made the 90
111-
minute drive to make it out to a show. But putting all of them on a bill
112-
together got me to buy a plane ticket to Paris, and have one of the best
113-
experiences of my life.
69+
When I was a kid I went to this <Link href="https://en.concerts-metal.com/concert_-_Hellfest_2008-3308.html">music festival</Link> in France where almost a hundred bands performed. There were a couple of bands on the bill I absolutely _loved_, knew every song, and would buy a ticket to see any day of the week.
11470

115-
I want Tailwind UI to feel like a music festival, where you can wander from
116-
stage to stage, enjoy a song or two from a band you've never heard of, and once
117-
in a while be blown away by a performance you would have never otherwise
118-
bothered to check out.
71+
Most of them though were bands I really _liked_, but wouldn't have made the 90 minute drive to make it out to a show. But putting all of them on a bill together got me to buy a plane ticket to Paris, and have one of the best experiences of my life.
11972

120-
So we're launching a new{" "}
73+
I want Tailwind UI to feel like a music festival, where you can wander from stage to stage, enjoy a song or two from a band you've never heard of, and once in a while be blown away by a performance you would have never otherwise bothered to check out.
12174

122-
<Link href="https://tailwindui.com/all-access">all-access package</Link> for Tailwind UI that includes access to every
123-
template and component package that exists today and any new content we add in the future.
75+
So we're launching a new <Link href="https://tailwindui.com/all-access">all-access package</Link> for Tailwind UI that includes access to every template and component package that exists today and any new content we add in the future.
12476

12577
<Image alt="Get Tailwind UI all-access" src={allAccess} />
12678

127-
It's a one-time purchase of **$299**. No subscription, no upgrade costs — if we
128-
add something new to Tailwind UI, it's yours, forever.
79+
It's a one-time purchase of **$299**. No subscription, no upgrade costs — if we add something new to Tailwind UI, it's yours, forever.
12980

130-
And if you already own everything in Tailwind UI, **we've upgraded you to
131-
all-access for free**.
81+
And if you already own everything in Tailwind UI, **we've upgraded you to all-access for free**.
13282

13383
---
13484

135-
So there you have it — that's everything we've been working on for the last few
136-
months!
85+
So there you have it — that's everything we've been working on for the last few months!
13786

138-
We've got a bunch of new templates in the works already, and we're actively
139-
working on extracting a lot of the component ideas from these templates into
140-
new examples to include in the Marketing, Application UI, and Ecommerce
141-
component categories.
87+
We've got a bunch of new templates in the works already, and we're actively working on extracting a lot of the component ideas from these templates into new examples to include in the Marketing, Application UI, and Ecommerce component categories.
14288

143-
That's one of my favorite things about working on these site templates —
144-
building real-world stuff with Tailwind is the best way for us to come up with
145-
new component ideas, and to find ways to improve both Tailwind CSS and Headless
146-
UI too.
89+
That's one of my favorite things about working on these site templates — building real-world stuff with Tailwind is the best way for us to come up with new component ideas, and to find ways to improve both Tailwind CSS and Headless UI too.
14790

14891
Look forward to lots of new Tailwind UI stuff in the coming months!

src/blog/2022-08-17-tailwind-framer-motion-template-and-tailwind-jobs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { adamwathan } from "@/app/blog/authors";
22
import { Figure } from "@/components/figure.tsx";
3-
import Image from "next/image";
3+
import { Image } from "@/components/media";
44
import Link from "next/link";
55

66
import tailwindJobs from "./tailwind-jobs.jpg";

src/blog/2022-09-09-new-personal-website-heroicons-2-headless-ui-v17/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import heroiconsCover from "./heroicons-cover.jpg";
66
import headlessuiV17 from "./headlessui-v17.jpg";
77
import playInsiders from "./play-insiders.png";
88
import phoenix from "./phoenix.png";
9-
import Image from "next/image";
9+
import { Image } from "@/components/media";
1010
import Link from "next/link";
1111
import { Example, Figure } from "@/components/example.tsx";
1212
import { CodeExampleGroup, CodeBlock, js, ts } from "@/components/code-example";

src/blog/2022-12-15-protocol-api-documentation-template/index.mdx

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { adamwathan } from "@/app/blog/authors";
2-
import Image from "next/image";
32
import Link from "next/link";
43
import { Example } from "@/components/example.tsx";
54
import { Figure } from "@/components/figure";
5+
import { Image, Video } from "@/components/media";
66

77
import home from "./home.png";
88
import documentation from "./documentation.png";
@@ -23,12 +23,12 @@ export const meta = {
2323
),
2424
};
2525

26-
It's been months in the making but I'm excited to finally release our next website template — <Link href="https://tailwindui.com/templates/protocol">Protocol</Link>, a beautiful starter kit for building amazing API reference websites.
27-
2826
<Link href="https://tailwindui.com/templates/protocol">
2927
<Image alt="Learn about the Protocol template" src={home} />
3028
</Link>
3129

30+
It's been months in the making but I'm excited to finally release our next website template — <Link href="https://tailwindui.com/templates/protocol">Protocol</Link>, a beautiful starter kit for building amazing API reference websites.
31+
3232
Powered by Next.js and MDX and styled with Tailwind CSS, it's built exactly the way we'd build our own API reference documentation.
3333

3434
Play with the <Link href="https://protocol.tailwindui.com/">live demo</Link> or <Link href="https://tailwindui.com/templates/protocol">download the source</Link> if you've got a Tailwind UI all-access license — it's a free update of course for all-access customers.
@@ -39,57 +39,15 @@ As usual we had a lot of fun getting carried away with the design, and putting t
3939

4040
We've got sticky code blocks that stay in view as you scroll through the request and response details for that endpoint:
4141

42-
<Example>
43-
{
44-
<div className="relative overflow-hidden rounded-2xl">
45-
<div className="pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-slate-900/10 ring-inset"></div>
46-
<video
47-
src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/sticky-code-blocks.mp4"
48-
autoPlay
49-
playsInline
50-
loop
51-
muted
52-
className="m-0 block"
53-
/>
54-
</div>
55-
}
56-
</Example>
42+
<Video src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/sticky-code-blocks.mp4" />
5743

5844
There's also this beautiful hover effect on the homepage cards — it follows your mouse cursor with this gradient glow that uncovers a subtle background pattern:
5945

60-
<Example>
61-
{
62-
<div className="relative overflow-hidden rounded-2xl">
63-
<div className="pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-slate-900/10 ring-inset"></div>
64-
<video
65-
src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/hovering-cards.mp4"
66-
autoPlay
67-
playsInline
68-
loop
69-
muted
70-
className="m-0 block"
71-
/>
72-
</div>
73-
}
74-
</Example>
46+
<Video src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/hovering-cards.mp4" />
7547

7648
My favorite detail though has to be the sidebar navigation, which tracks the visible page content but using a sort of "minimap" strategy, where _all_ visible page sections are highlighted:
7749

78-
<Example>
79-
{
80-
<div className="relative overflow-hidden rounded-2xl">
81-
<div className="pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-slate-900/10 ring-inset"></div>
82-
<video
83-
src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/animated-sidebar.mp4"
84-
autoPlay
85-
playsInline
86-
loop
87-
muted
88-
className="m-0 block"
89-
/>
90-
</div>
91-
}
92-
</Example>
50+
<Video src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/animated-sidebar.mp4" />
9351

9452
Watching this animate as you scroll through the page is really a sight to behold — props to <Link href="https://www.framer.com/motion/">Framer Motion</Link> for doing the heavy lifting here as usual. Even if I absolutely hated React I'm pretty sure I'd still use it just to use this library, it's really that good.
9553

@@ -228,21 +186,7 @@ We love Algolia for documentation search, and we use it for the Tailwind CSS web
228186

229187
We've wired it up for Protocol as well, but this time using Algolia's headless <Link href="https://www.algolia.com/doc/ui-libraries/autocomplete/introduction/what-is-autocomplete/">autocomplete library</Link> so we had total control of the search UI:
230188

231-
<Example>
232-
{
233-
<div className="relative overflow-hidden rounded-2xl">
234-
<div className="pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-slate-900/10 ring-inset"></div>
235-
<video
236-
src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/command-palette.mp4"
237-
autoPlay
238-
playsInline
239-
loop
240-
muted
241-
className="m-0 block"
242-
/>
243-
</div>
244-
}
245-
</Example>
189+
<Video src="https://assets.tailwindcss.com/blog/2022-12-15-protocol-api-documentation-template/command-palette.mp4" />
246190

247191
The nice thing about this approach is we can use regular old utility classes to style everything instead of writing custom CSS to style an already-styled widget, which just feels a lot more _right_ in a Tailwind CSS project.
248192

src/blog/2023-04-24-new-changelog-template-and-the-biggest-tailwind-ui-update-ever/index.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { adamwathan } from "@/app/blog/authors";
22
import twitterCard from "./twitter-card.png";
33
import Link from "next/link";
4-
import Image from "next/image";
4+
import { Image } from "@/components/media";
55
import commitTemplate from "./commit-template.png";
66
import commitTemplateDarkMode from "./commit-template-dark-mode.png";
77
import commitTemplateForMotionOne from "./commit-template-for-motion-one.png";
@@ -36,11 +36,9 @@ Over the last four months we've probably done more work on Tailwind UI than we e
3636

3737
Just a few days ago we released [Commit](https://tailwindui.com/templates/commit), a brand new changelog template we designed for Tailwind UI — built of course with Tailwind CSS and Next.js.
3838

39-
<p>
40-
<Link href="https://tailwindui.com/templates/commit">
41-
<Image src={commitTemplate} alt="The Commit template" />
42-
</Link>
43-
</p>
39+
<Link href="https://tailwindui.com/templates/commit">
40+
<Image src={commitTemplate} alt="The Commit template" />
41+
</Link>
4442

4543
Public changelogs have become a really popular way to keep people in the loop about what you've been working on, and to stay accountable and build your shipping muscles. They aren't a new concept by any means of course, but I don't think it was until [Linear](https://linear.app/changelog) started publishing to their changelog site that others got excited about using them almost as an alternative to a company blog.
4644

Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)