How to use the css-tree/data.properties function in css-tree

To help you get started, we’ve selected a few css-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prometheusresearch-archive / react-stylesheet / scripts / make-CSSType.js View on Github external
}
  return node;
}

function typeName(name) {
  return toCamelCase(name) + 'T';
}

function propertyName(name) {
  return toCamelCase(name);
}

let statementList = [];
let propList = [];

for (let key in cssData.properties) {
  let prop = parseSyntax(cssData.properties[key]);
  key = toCamelCase(key);
  statementList.push(
    t.exportNamedDeclaration(
      t.typeAlias(
        t.identifier(propertyName(key)),
        null,
        normalizeType(buildType(prop, key)),
      ),
      [],
      t.stringLiteral('type'),
    ),
  );
  let typeProp = t.objectTypeProperty(t.identifier(key), t.identifier(propertyName(key)));
  typeProp.optional = true;
  propList.push(typeProp);
github prometheusresearch-archive / react-stylesheet / scripts / make-CSSType.js View on Github external
return node;
}

function typeName(name) {
  return toCamelCase(name) + 'T';
}

function propertyName(name) {
  return toCamelCase(name);
}

let statementList = [];
let propList = [];

for (let key in cssData.properties) {
  let prop = parseSyntax(cssData.properties[key]);
  key = toCamelCase(key);
  statementList.push(
    t.exportNamedDeclaration(
      t.typeAlias(
        t.identifier(propertyName(key)),
        null,
        normalizeType(buildType(prop, key)),
      ),
      [],
      t.stringLiteral('type'),
    ),
  );
  let typeProp = t.objectTypeProperty(t.identifier(key), t.identifier(propertyName(key)));
  typeProp.optional = true;
  propList.push(typeProp);
}