Skip to content

Commit

Permalink
Merge pull request tailwindlabs#5 from EmilTholin/prefix_function_docs
Browse files Browse the repository at this point in the history
Document the function prefix feature
  • Loading branch information
adamwathan committed Feb 19, 2019
2 parents be0dafc + 0b1d1a2 commit 9528bc4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/docs/configuration.blade.md
Expand Up @@ -234,6 +234,24 @@ For example, you could add a `tw-` prefix by setting the `prefix` option like so
}
```

+You can also pass a function to the `prefix` option if you need more fine-grained control:

```js
{
// ...
options: {
prefix: function (selector) {
if (selector === '.container') {
return 'tw-'
}

return ''
},
// ...
}
}
```

It's important to understand that this prefix is added to the beginning of each *utility* name, not to the entire class name.

That means that classes with responsive or state prefixes like `sm:` or `hover:` will still have the responsive or state prefix *first*, with your custom prefix appearing after the colon:
Expand Down

0 comments on commit 9528bc4

Please sign in to comment.