Skip to content

Commit 7f05797

Browse files
committed
Add prettier plugin update post
1 parent afa610b commit 7f05797

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { adamwathan } from '@/authors'
2+
import card from './card.jpg'
3+
4+
export const meta = {
5+
title: 'Automatically clean up whitespace and duplicate class names',
6+
description: 'We just released a new version of prettier-plugin-tailwindcss which adds support for removing unnecessary whitespace and duplicate classes when sorting.',
7+
date: '2024-05-31T16:30:00.000Z',
8+
authors: [adamwathan],
9+
image: card,
10+
}
11+
12+
{/*excerpt*/}
13+
14+
We just released a new version of `prettier-plugin-tailwindcss` which adds support for removing unnecessary whitespace and duplicate classes when sorting.
15+
16+
{/*/excerpt*/}
17+
18+
![Catalyst application layout preview](./card.jpg)
19+
20+
We just released a new version of `prettier-plugin-tailwindcss` which adds support for removing unnecessary whitespace and duplicate classes when sorting.
21+
22+
---
23+
24+
## Cleaning up unnecessary whitespace
25+
26+
When you're copying around class names or deleting a class name from the middle of a list, it's easy to end up with some extra whitespace that needs to be cleaned up.
27+
28+
Now our Prettier plugin will handle this for you automatically, so you don't need to clean it up yourself.
29+
30+
<div className="relative rounded-2xl overflow-hidden">
31+
<div className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-slate-900/10 pointer-events-none"></div>
32+
<video src="https://assets.tailwindcss.com/blog%2F2024-05-30-prettier-plugin-collapse-whitespace%2Fremove-whitespace-3.mp4" autoPlay playsInline loop muted className="block m-0 min-w-[550px]" />
33+
</div>
34+
35+
---
36+
37+
## Removing duplicate classes
38+
39+
Our [VS Code extension](https://tailwindcss.com/docs/editor-setup#intelli-sense-for-vs-code) has warned you about duplicate class names for a long time, but now our Prettier plugin can remove those duplicate classes for you automatically.
40+
41+
<div className="relative rounded-2xl overflow-hidden">
42+
<div className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-slate-900/10 pointer-events-none"></div>
43+
<video src="https://assets.tailwindcss.com/blog%2F2024-05-30-prettier-plugin-collapse-whitespace%2Fprettier-remove-duplicates.mp4" autoPlay playsInline loop muted className="block m-0 min-w-[550px]" />
44+
</div>
45+
46+
47+
---
48+
49+
To start playing with these improvements in your own projects, just install the latest version:
50+
51+
```sh
52+
$ npm i prettier-plugin-tailwindcss@latest
53+
```
54+
55+
If you run into any issues, let us know on [GitHub](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/)!

0 commit comments

Comments
 (0)