UNPKG

@yuo/postcss-px2vw

Version:

support postcss@v8.x, px2vw

11 lines (9 loc) 376 B
// excluding regex trick: http://www.rexegg.com/regex-best-trick.html // Not anything inside double quotes // Not anything inside single quotes // Not anything inside url() // Any digit followed by px // !singlequotes|!doublequotes|!url()|pixelunit module.exports = { getUnitRegexp: unit => new RegExp('"[^"]+"|\'[^\']+\'|url\\([^\\)]+\\)|(\\d*\\.?\\d+)' + unit, 'g') };