How to use the css-in-js-utils/lib/isPrefixedValue 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 / inline-style-prefixer / modules / plugins / transition.js View on Github external
function prefixValue(value: string, propertyPrefixMap: Object): string {
  if (isPrefixedValue(value)) {
    return value
  }

  // only split multi values, not cubic beziers
  const multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g)

  for (let i = 0, len = multipleValues.length; i < len; ++i) {
    const singleValue = multipleValues[i]
    const values = [singleValue]
    for (const property in propertyPrefixMap) {
      const dashCaseProperty = hyphenateProperty(property)

      if (
        singleValue.indexOf(dashCaseProperty) > -1 &&
        dashCaseProperty !== 'order'
      ) {
github robinweser / inline-style-prefixer / modules / plugins / gradient.js View on Github external
export default function gradient(property: string, value: any): ?Array {
  if (
    typeof value === 'string' &&
    !isPrefixedValue(value) &&
    values.test(value)
  ) {
    return prefixes.map(prefix => value.replace(values, grad => prefix + grad))
  }
}
github robinweser / inline-style-prefixer / modules / plugins / calc.js View on Github external
export default function calc(property: string, value: any): ?Array {
  if (
    typeof value === 'string' &&
    !isPrefixedValue(value) &&
    value.indexOf('calc(') > -1
  ) {
    return prefixes.map(prefix => value.replace(/calc\(/g, `${prefix}calc(`))
  }
}
github robinweser / inline-style-prefixer / modules / plugins / filter.js View on Github external
export default function filter(property: string, value: any): ?Array {
  if (
    typeof value === 'string' &&
    !isPrefixedValue(value) &&
    value.indexOf('filter(') > -1
  ) {
    return prefixes.map(prefix =>
      value.replace(/filter\(/g, `${prefix}filter(`)
    )
  }
}
github robinweser / inline-style-prefixer / modules / plugins / imageSet.js View on Github external
export default function imageSet(property: string, value: any): ?Array {
  if (
    typeof value === 'string' &&
    !isPrefixedValue(value) &&
    value.indexOf('image-set(') > -1
  ) {
    return prefixes.map(prefix =>
      value.replace(/image-set\(/g, `${prefix}image-set(`)
    )
  }
}
github robinweser / inline-style-prefixer / modules / plugins / crossFade.js View on Github external
export default function crossFade(
  property: string,
  value: any
): ?Array {
  if (
    typeof value === 'string' &&
    !isPrefixedValue(value) &&
    value.indexOf('cross-fade(') > -1
  ) {
    return prefixes.map(prefix =>
      value.replace(/cross-fade\(/g, `${prefix}cross-fade(`)
    )
  }
}