Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit 4b9663a

Browse files
committed
Add note about important modifier to README
1 parent 8b962ca commit 4b9663a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Now start your dev server or build tool as you normally would and you're good to
6868
> Make sure you set `NODE_ENV=development` if you are running a watcher, or Tailwind won't watch your template files for changes. Set `NODE_ENV=production` for one-off builds.
6969
>
7070
> If you want to control whether Tailwind watches files or not more explicitly, set `TAILWIND_MODE=watch` or `TAILWIND_MODE=build` to override the default `NODE_ENV`-based behavior.
71-
>
71+
>
7272
> For example if you want to do one-off builds with `NODE_ENV=development`, explicitly set `TAILWIND_MODE=build` so that Tailwind knows you are just doing a one-off build and doesn't hang.
7373
7474
## Documentation
@@ -116,6 +116,25 @@ This is very useful for building pixel-perfect designs where there are a few ele
116116

117117
We'll likely add some form of "strict mode" in the future for power-hungry team leads who don't trust their colleagues to use this feature responsibly.
118118

119+
### Built-in important modifier
120+
121+
You can make any utility important by adding a `!` character to the beginning:
122+
123+
```html
124+
<p class="font-bold !font-medium">
125+
This will be medium even though bold comes later in the CSS.
126+
</p>
127+
```
128+
129+
The `!` always goes at the beginning of the utility name, after any variants, but before any prefix:
130+
131+
```diff
132+
- !sm:hover:tw-font-bold
133+
+ sm:hover:!tw-font-bold
134+
```
135+
136+
This can be useful in rare situations where you need to increase specificity because you're at war with some styles you don't control.
137+
119138
## Known limitations
120139

121140
This library is very close to feature parity with `tailwindcss` currently and for most projects I bet you'll find it works exactly as you'd expect.

0 commit comments

Comments
 (0)