uncss, regex pattern for .no-'string', .is-'string'

旧城冷巷雨未停 提交于 2019-12-11 23:27:38

问题


I'm having some regex woes.

Using gulp-uncss

I'd like to add some classes to the ignore option.

Any class that starts with .no-

Any class that contains .is-

.no-flexbox {}
.test.is-active {}
.test .is-hidden {}


.pipe(uncss({
    html: ['tmp/public_html/*.html'],
    ignore: ['/(.is-)(\w)*', '(.no-)(\w)*']
}))

This isn't quite right


回答1:


Your regexes look incomplete. May be you should do like this

.pipe(uncss({
    html: ['tmp/public_html/*.html'],
    ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g']
}))


来源:https://stackoverflow.com/questions/36358172/uncss-regex-pattern-for-no-string-is-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!