purge does not include class needed by Switch component
i8ramin opened this issue · comments
Look like the tailwind purge
process removes some classes needed by the Switch
component. Namely .bg-primary-200
(defined here
I am guessing b/c the classname is being added dynamically using a variable. What is the best way to fix this? I tried setting whitelistPatterns in the config, but that didn't seem to work:
whitelistPatterns: [/\.bg-/]
I was able to get around this by setting the following whitelist: ['bg-primary-200', 'bg-primary-400']
... but would rather not hardcode it in the config
Hi, with the latest update (1.1.5
) this seems to no longer work. I have whitelist: ['bg-primary-200', 'bg-primary-400']
but when I do a production build, the Switch component does not display properly. Example below.
I can see the classnames being added, but the styles are missing. I wonder, does this happen with other components that define variants the same way?