How to use the known-css-properties.all.filter 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 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 diegohaz / singel / src / utils.js View on Github external
export const getStyleProps = (): Object =>
  cssProps
    .filter(prop => !/^-/.test(prop))
    .map(camelCase)
    .reduce(reducer, {});

known-css-properties

List of known CSS properties

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis