How to use the css-in-js-utils/lib/unprefixProperty function in css-in-js-utils

To help you get started, we’ve selected a few css-in-js-utils 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 robinweser / bredon / packages / bredon-validate / src / isValidProperty.js View on Github external
export default function isValidProperty(
  property: string,
  ast: any,
  isList?: boolean = false
): boolean {
  // if we do not know a property, we just skip it
  // and pretend its valid anyways
  // TODO: add valid property list
  if (!properties.hasOwnProperty(property)) {
    const unprefixedProperty = unprefixProperty(property)

    // we also check for prefixed properties that are
    // actually standard CSS properties
    if (properties.hasOwnProperty(unprefixedProperty)) {
      return isValidProperty(unprefixedProperty, ast, isList)
    }

    // TODO: remove as soon as 100% props are covered
    if (_missingProps.indexOf(property) !== -1) {
      return true
    }

    console.warn(
      `Unknown property: "${property}". If it is a valid CSS property, please file an issue.
https://github.com/rofrischmann/bredon/issues/new`
    )