codyhouse/codyhouse-framework

PurgeCSS ignores breakpoint classes

retroriff opened this issue · 2 comments

I have added PurgeCSS into my Grunt tasks and it works but it exclude classes with breakpoints such as "display@md". I have tried to whitelist them but it didn't work. These are the options that I tried:

whitelist: ['display@sm', 'display\\@sm']
whitelistPatterns: [/^display/]

All CodyHouse classes that contain special characters are ignored by PurgeCSS, like "width-100%" or "height-100%".

Hi, you should use the defaultExtractor option. Something like:

defaultExtractor: content => content.match(/[\w-/:%@]+(?<!:)/g) || []

@claudia-romano It worked like a charm, thank you!