How to use the known-css-properties.all.indexOf function in known-css-properties

To help you get started, we’ve selected a few known-css-properties 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 sasstools / sass-lint / lib / rules / property-sort-order.js View on Github external
block.forEach('declaration', function (dec) {
          var prop = dec.first('property'),
              name = prop.first('ident');

          if (name) {
            if (parser.options['ignore-custom-properties']) {
              // lazy load our css property list
              const propertyList = require('known-css-properties').all;
              if (propertyList.indexOf(name.content) !== -1) {
                properties[name.content] = prop;
              }
            }
            else {
              properties[name.content] = prop;
            }
          }
        });
github stylelint / stylelint / src / rules / property-no-unknown / index.js View on Github external
root.walkDecls(decl => {
      const { prop } = decl

      if (!isStandardSyntaxProperty(prop)) { return }
      if (!isStandardSyntaxDeclaration(decl)) { return }
      if (isCustomProperty(prop)) { return }

      if (!shouldCheckPrefixed && vendor.prefix(prop)) { return }

      if (optionsMatches(options, "ignoreProperties", prop)) { return }

      if (properties.indexOf(prop.toLowerCase()) !== -1) { return }

      report({
        message: messages.rejected(prop),
        node: decl,
        result,
        ruleName,
      })
    })
  }
github stylelint / stylelint / lib / rules / property-no-unknown / index.js View on Github external
return;
      }

      if (isCustomProperty(prop)) {
        return;
      }

      if (!shouldCheckPrefixed && postcss.vendor.prefix(prop)) {
        return;
      }

      if (optionsMatches(options, "ignoreProperties", prop)) {
        return;
      }

      if (properties.indexOf(prop.toLowerCase()) !== -1) {
        return;
      }

      report({
        message: messages.rejected(prop),
        node: decl,
        result,
        ruleName
      });
    });
  };

known-css-properties

List of known CSS properties

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis