index.js
function (properties, rule, options) {
  var signature = rule.selector || rule.params;
  var name = signature.match(customPropertyPattern).shift().replace(propertyKeyDelimiter, '').trim();
  var parameters = signature.replace(customPropertyPattern, '').match(parametersPattern).map(function (parameter) {
    return parameter.replace(options.syntax.parameter, options.syntax.variable);
  });

  var property = {
    name: name,
    parameters: parameters,
    declarations: rule.nodes.map(function (node) {
      return {
        property: node.prop,
        value: node.value,
        // Parses variables that are also parameters. Ignores other variables for compatability with Sass variables.
        // We only need the index of each parameter
        variables: (node.value.match(variablesPattern) || [])
        .filter(function (variable) {
          return node.value.indexOf(variable) !== -1;
        }).map(function (variable) {
          return parameters.indexOf(variable);
        })
      };
    })
  };

  properties[options.syntax.property + property.name + signatureSeparator + parameters.length] = property;
  rule.remove();
}
function (properties, rule, options) {
  var signature = rule.selector || rule.params;
  var name = signature.match(customPropertyPattern).shift().replace(propertyKeyDelimiter, '').trim();
  var parameters = signature.replace(customPropertyPattern, '').match(parametersPattern).map(function (parameter) {
    return parameter.replace(options.syntax.parameter, options.syntax.variable);
  });

  var property = {
    name: name,
    parameters: parameters,
    declarations: rule.nodes.map(function (node) {
      return {
        property: node.prop,
        value: node.value,
        // Parses variables that are also parameters. Ignores other variables for compatability with Sass variables.
        // We only need the index of each parameter
        variables: (node.value.match(variablesPattern) || [])
        .filter(function (variable) {
          return node.value.indexOf(variable) !== -1;
        }).map(function (variable) {
          return parameters.indexOf(variable);
        })
      };
    })
  };

  properties[options.syntax.property + property.name + signatureSeparator + parameters.length] = property;
  rule.remove();
}
function ( properties , rule , options ) { var signature = rule . selector || rule . params ; var name = signature . match ( customPropertyPattern ) . shift ( ) . replace ( propertyKeyDelimiter , '' ) . trim ( ) ; var parameters = signature . replace ( customPropertyPattern , '' ) . match ( parametersPattern ) . map ( function ( parameter ) { return parameter . replace ( options . syntax . parameter , options . syntax . variable ) ; } ) ; var property = { name : name , parameters : parameters , declarations : rule . nodes . map ( function ( node ) { return { property : node . prop , value : node . value , // Parses variables that are also parameters. Ignores other variables for compatability with Sass variables. // We only need the index of each parameter variables : ( node . value . match ( variablesPattern ) || [ ] ) . filter ( function ( variable ) { return node . value . indexOf ( variable ) !== - 1 ; } ) . map ( function ( variable ) { return parameters . indexOf ( variable ) ; } ) } ; } ) } ; properties [ options . syntax . property + property . name + signatureSeparator + parameters . length ] = property ; rule . remove ( ) ; }
Adds a property definition to properties
Adds a property definition to properties