Skip to content

How to use regex in safelist? #132

Answered by antfu
shiftgeist asked this question in Q&A
Discussion options

You must be logged in to vote

The story of PurgeCSS and on-demand-based are different, since it's on-demand, we actually have infinite many possibilities of classes. So regex can't work well with this in terms of safelist (might work for blocklist tho).

For now, I'd suggest using a function to generate the combinations you think you are going to use https://github.com/windicss/vite-plugin-windicss#safelist

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shiftgeist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants