postcss-rem-to-rem-multiplier
Version:
multiply the rem (root em) units with a multiplier using PostCSS. Based on postcss-rem-to-pixel.
10 lines (7 loc) • 316 B
JavaScript
// 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 rem
// !singlequotes|!doublequotes|!url()|remunit
module.exports = /"[^"]+"|'[^']+'|url\([^\)]+\)|(\d*\.?\d+)rem/g;