Skip to content

Commit

Permalink
docs: add whitelist section to purge (#250)
Browse files Browse the repository at this point in the history
* docs: add whitelist section to purge

* Update tailwind-config.md

* Update tailwind-config.md

Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
  • Loading branch information
Geminii and atinux authored Jan 25, 2021
1 parent b193d5e commit 4e120e7
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/content/en/tailwind-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ category: Guide

## Default Configuration

```js
```js{}[tailwind.config.js]
{
theme: {},
variants: {},
Expand Down Expand Up @@ -79,7 +79,7 @@ Learn more about the [Tailwind config](https://tailwindcss.com/docs/configuratio

You can also use your `nuxt.config.js` to set your Tailwind Config with the `tailwindcss.config` property:

```js{}[nuxt.config.js]
```js [nuxt.config.js]
import tailwindTypography from '@tailwindcss/typography'

export default {
Expand Down Expand Up @@ -186,6 +186,22 @@ This merging strategy of with a function only applies to `plugins` and `purge.co

</alert>

### Whitelisting classes

If you need to whitelisting classes and avoid purge system, you need to precise `safelist` option like below :

```js{}[tailwind.config.js]
module.exports = {
purge: {
options: {
// Whitelisting some classes to avoid purge
safelist: ['whitelisted']
}
}
}
```


## Referencing in the application

It can often be useful to reference tailwind configuration values in runtime. For example to access some of your theme values when dynamically applying inline styles in a component.
Expand Down

0 comments on commit 4e120e7

Please sign in to comment.