Skip to content

Commit c974800

Browse files
authored
Add important selector strategy note to purge (#885)
Use same wording from [`important` selector strategy section](https://tailwindcss.com/docs/configuration#selector-strategy), with added "`important` with"
1 parent 25bcd20 commit c974800

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pages/docs/optimizing-for-production.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ module.exports = {
123123

124124
**This list should include *any* files in your project that reference any of your styles by name.** For example, if you have a JS file in your project that dynamically toggles some classes in your HTML, you should make sure to include that file in this list.
125125

126+
When using `important` with the [selector strategy](/docs/configuration#selector-strategy), be sure that the template file that includes your root selector is included in your purge configuration, otherwise all of your CSS will be removed when building for production.
127+
126128
Now whenever you compile your CSS with `NODE_ENV` set to `production`, Tailwind will automatically purge unused styles from your CSS.
127129

128130
### Enabling manually

0 commit comments

Comments
 (0)