I'd like PurgeCSS to ignore specific classes, as I have noticed that styles for specific external scripts are gone.
This seems to work:
whitelist: ['vfl-label-on-input', 'vfl-has-label', 'vfl-label', 'label']
However, I have tried doing like so:
whitelistPatterns: [/viewer$/, /vfl$/]
I'd like to whitelist "viewer" and "viewer-canvas" as well as "vfl-has-label", etc.
But that does not work.
Not sure what I am doing wrong
How does this work on the cli line?
I tried
purgecss --css csscache/st__blue_.css --output csspurified/ --content '[index.php, something.php]' --whitelist border_blue, border_green
and
purgecss --css csscache/st__blue_.css --output csspurified/ --content '[index.php, something.php]' --whitelist '[border_blue, border_green]'
but the class .border_blue and green are gone
@simplenotezy whitelistPatterns is using regular expression to match the selectors you want to ignore.
You can try your regular expression on a website like RegExr.
/viewer$/ will not whitelist viewer-canvas because it will match selectors ending with viewer.
/vfl$/ will whitelist selectors ending with vfl
@rubo77 whitelist should be comma separated -- whitelist border_blue,border_green
I would recommend using a configuration file when the configuration is _complicated_. It will be easier:
purgecss --config ./purgecss.config.js