MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getVars

Function getVars

lib/vars.js:18–32  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

16
17// Parse variables from a file with postcss.
18function 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.
35function getUniqueVars(vars) {

Callers 2

getVariableMappingsFunction · 0.70
vars.jsFile · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected