(file)
| 16 | |
| 17 | // Parse variables from a file with postcss. |
| 18 | function getVars(file) { |
| 19 | let contents = fs.readFileSync(file, 'utf8'); |
| 20 | let root = postcss.parse(contents); |
| 21 | |
| 22 | let vars = {}; |
| 23 | root.walkRules(rule => { |
| 24 | rule.walkDecls(decl => { |
| 25 | if (customPropertyRegExp.test(decl.prop)) { |
| 26 | vars[decl.prop] = decl.value; |
| 27 | } |
| 28 | }); |
| 29 | }); |
| 30 | |
| 31 | return vars; |
| 32 | } |
| 33 | |
| 34 | // Find variables with unique values, and create a mapping between them. |
| 35 | function getUniqueVars(vars) { |
no test coverage detected