Skip to content

Commit 9fe3e0d

Browse files
committed
update docs
1 parent ed85552 commit 9fe3e0d

3 files changed

Lines changed: 19 additions & 16 deletions

File tree

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# [Tailwind clamp](https://nicolas-cusan.github.io/tailwind-clamp/)
1+
# [Tailwind clamp 🗜️](https://nicolas-cusan.github.io/tailwind-clamp/)
22

3-
Leverage the CSS `clamp` function in your [Tailwind CSS](https://tailwindcss.com/) project.
3+
**Fluid interfaces. From mobile to desktop.**
4+
5+
[Tailwind CSS](https://tailwindcss.com/) plugin to build responsive interfaces that scale smoothly using CSS `clamp()` without breakpoint micromanagement.
46

57
## Features
68

@@ -28,7 +30,7 @@ npm i tailwind-clamp
2830
Add the plugin in your main CSS file:
2931

3032
```css
31-
@import 'tailwindcss';
33+
@import "tailwindcss";
3234
@plugin "tailwind-clamp";
3335
```
3436

@@ -44,10 +46,10 @@ The plugin allows two configuration options:
4446
Value should be a css length (`px`, `rem`, `em`). The unit for both options need to match.
4547

4648
```css
47-
@import 'tailwindcss';
49+
@import "tailwindcss";
4850
@plugin "tailwind-clamp" {
49-
minsize: 25rem;
50-
maxsize: 80rem;
51+
minSize: 25rem;
52+
maxSize: 80rem;
5153
}
5254
```
5355

@@ -87,8 +89,7 @@ All spacing and sizing properties (`p`, `m`, `w`, etc.) accept unitless numbers
8789

8890
```html
8991
<div class="clamp-[p,1,2]">
90-
This will generate a `padding` value of `1rem` at `minSize` and `2rem` at
91-
`maxSize`.
92+
This will generate a `padding` value of `1rem` at `minSize` and `2rem` at `maxSize`.
9293
</div>
9394
```
9495

@@ -209,26 +210,27 @@ npm i tailwind-clamp-merge
209210
```
210211

211212
```js
213+
212214
const twMerge = extendTailwindMerge(withTailwindClamp);
213215
```
214216

215217
This teaches tailwind-merge that `clamp-[p,1,3]` belongs to the same class group as `p-4`, so conflicts are resolved correctly:
216218

217219
```js
218-
twMerge('p-4 clamp-[p,1,3]');
220+
twMerge('p-4 clamp-[p,1,3]')
219221
// => 'clamp-[p,1,3]'
220222

221-
twMerge('clamp-[p,1,3] p-4');
223+
twMerge('clamp-[p,1,3] p-4')
222224
// => 'p-4'
223225

224-
twMerge('text-lg clamp-[text,lg,3xl]');
226+
twMerge('text-lg clamp-[text,lg,3xl]')
225227
// => 'clamp-[text,lg,3xl]'
226228

227229
// Hierarchical conflicts work too
228-
twMerge('px-4 py-2 clamp-[p,1,3]');
230+
twMerge('px-4 py-2 clamp-[p,1,3]')
229231
// => 'clamp-[p,1,3]'
230232

231-
twMerge('w-4 h-8 clamp-[size,10,20]');
233+
twMerge('w-4 h-8 clamp-[size,10,20]')
232234
// => 'clamp-[size,10,20]'
233235
```
234236

@@ -242,4 +244,4 @@ See also [fluid.tw](https://fluid.tw/) by [Max Barvian](https://barvian.me/).
242244

243245
## License
244246

245-
MIT
247+
MIT

packages/docs/src/content/docs.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Note from '../components/Note.astro';
88
import ResizeDemo from '../components/ResizeDemo.astro';
99

1010
<Conditional target="md">
11-
1211
# [Tailwind clamp 🗜️](https://nicolas-cusan.github.io/tailwind-clamp/)
1312

1413
**Fluid interfaces. From mobile to desktop.**

packages/tailwind-clamp/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# [Tailwind clamp 🗜️](https://nicolas-cusan.github.io/tailwind-clamp/)
22

3-
Leverage the the CSS `clamp` function in your [Tailwind CSS](https://tailwindcss.com/) project.
3+
**Fluid interfaces. From mobile to desktop.**
4+
5+
[Tailwind CSS](https://tailwindcss.com/) plugin to build responsive interfaces that scale smoothly using CSS `clamp()` without breakpoint micromanagement.
46

57
## Features
68

0 commit comments

Comments
 (0)