Compatibility with `purge`
When setting up tailwind'd purge feature, our named groups appear to be purged. Is it possible to configure named groups in the safelist?
As of Tailwind 3.0 I was having some problems with JIT purging classes inconsistently for the named groups (especially when having nested groups - usually would take the parent and purge the child).
I used the following in my config:
const config = {
...
safelist: [{
pattern: /.*/,
variants: [
"group-hover",
"group-focus"
]
}],
...
};
Note - this is working because it's safelisting all group tags of hover and focus across all the variants (so it may not be the smallest bundle you can get to -- you may want to narrow down the pattern a bit), but it works for my use-case.
Extending on the above answer, my working code for tailwind 3.x in tailwind.config.js is:
...
module.exports = {
content: [
...
],
// safelisting so that namedGroups can work in tailwind 3.x
safelist: [{
pattern: /.*/,
variants: [
"group-hover",
"group-focus"
]
}],
...
Thanks @m-rgba