How to use known-css-properties - 10 common examples

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 diegohaz / singel / src / testComponent.js View on Github external
import Adapter from "enzyme-adapter-react-16";
import { flow, camelCase, omit } from "lodash";
import sinon from "sinon";
import voidElements from "void-elements";
import { all as cssProps } from "known-css-properties";
import htmlProps from "react-known-props";
import ariaProps from "aria-attributes/index.json";
// $FlowFixMe
import safeHtmlProps from "react-html-attributes";
import { findHTMLTags, getHTMLTag, findHTMLTag } from "./utils";

type TestFn = (Element: ComponentType) => ComponentType;

configure({ adapter: new Adapter() });

const styleProps = cssProps
  .filter(prop => !/^-/.test(prop))
  .map(camelCase)
  .reduce(
    (acc, prop) => ({
      ...acc,
      [prop]: prop
    }),
    {}
  );

const reactProps = [...safeHtmlProps["*"], ...ariaProps]
  .filter(
    prop =>
      !/^style|className|allowTransparency|srcLang|suppressContentEditableWarning|capture|marginWidth|marginHeight|classID|is|keyType|keyParams|charSet|dangerouslySetInnerHTML|on[A-Z].+$/.test(
        prop
      )
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 sasstools / sass-lint / lib / rules / no-misspelled-properties.js View on Github external
'use strict';

var helpers = require('../helpers');
var properties = require('known-css-properties').all;
// Keep track of our properties we need to skip from the gonzales loop
var skipProps = 0;
/**
 * Combine the valid property array and the array of extras into a new array
 *
 * @param {Array} props - The list of default valid properties
 * @param {Array} extras - The user specified list of valid properties
 * @returns {Array} Combined list
 */
var getCombinedList = function (props, extras) {
  return props.concat(extras);
};

/**
 * Combines the base property name with the current property name to correct a full property name
 *
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 diegohaz / singel / src / utils.js View on Github external
export const getStyleProps = (): Object =>
  cssProps
    .filter(prop => !/^-/.test(prop))
    .map(camelCase)
    .reduce(reducer, {});
github UniversalStandard / ook / index.js View on Github external
export const OokConfig = ({
  breakpoints = {},
  cssProperties = knownCssProperties.all,
  children,
}) => (
  
    
      {ctx => {
        return children
      }}
    
  
)
github stylelint / stylelint / lib / rules / property-no-unknown / index.js View on Github external
"use strict";

const _ = require("lodash");
const isCustomProperty = require("../../utils/isCustomProperty");
const isStandardSyntaxDeclaration = require("../../utils/isStandardSyntaxDeclaration");
const isStandardSyntaxProperty = require("../../utils/isStandardSyntaxProperty");
const optionsMatches = require("../../utils/optionsMatches");
const postcss = require("postcss");
const properties = require("known-css-properties").all;
const report = require("../../utils/report");
const ruleMessages = require("../../utils/ruleMessages");
const validateOptions = require("../../utils/validateOptions");

const ruleName = "property-no-unknown";

const messages = ruleMessages(ruleName, {
  rejected: property => `Unexpected unknown property "${property}"`
});

const rule = function(actual, options) {
  return (root, result) => {
    const validOptions = validateOptions(
      result,
      ruleName,
      { actual },
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 1 month ago

Package Health Score

83 / 100
Full package analysis