UNPKG

postcss-fixie

Version:

Simple functions to use IE-specific CSS hacks

16 lines (10 loc) 414 B
"use strict"; var postcss = require("postcss"), hacks = require("./hacks.js"), search = new RegExp(`:(${Object.keys(hacks).join(")|:(")})`); module.exports = postcss.plugin("postcss-fixie", () => (root) => { root.walkRules(search, (rule) => { var version = rule.selector.match(search)[0].substring(1); rule.replaceWith(hacks[version](rule.clone())); }); });