How to use the fela-utils.processStyleWithPlugins function in fela-utils

To help you get started, we’ve selected a few fela-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 / fela / packages / fela / src / createRenderer.js View on Github external
renderKeyframe(keyframe: Function, props: Object = {}): string {
      const resolvedKeyframe = keyframe(props, renderer)
      const processedKeyframe = processStyleWithPlugins(
        renderer,
        resolvedKeyframe,
        KEYFRAME_TYPE,
        props
      )

      const keyframeReference = JSON.stringify(processedKeyframe)

      if (!renderer.cache.hasOwnProperty(keyframeReference)) {
        // use another unique identifier to ensure minimal css markup
        const animationName =
          renderer.selectorPrefix +
          generateAnimationName(++renderer.uniqueKeyframeIdentifier)

        const cssKeyframe = cssifyKeyframe(
          processedKeyframe,
github robinweser / fela / packages / fela / src / cssifyStaticStyle.js View on Github external
export default function cssifyStaticStyle(
  staticStyle: string | Object,
  renderer: DOMRenderer
): string {
  if (typeof staticStyle === 'string') {
    return minifyCSSString(staticStyle)
  }

  const processedStaticStyle = processStyleWithPlugins(
    renderer,
    staticStyle,
    STATIC_TYPE
  )

  return cssifyObject(processedStaticStyle)
}
github robinweser / fela / packages / fela / src / createRenderer.js View on Github external
_renderStyle(style: Object = {}, props: Object = {}): string {
      const processedStyle = processStyleWithPlugins(
        renderer,
        style,
        RULE_TYPE,
        props
      )

      return renderer._renderStyleToClassNames(processedStyle).slice(1)
    },
    _renderStyleToClassNames(
github robinweser / fela / packages / fela-native / src / index.js View on Github external
renderRule(rule: Function, props: Object = {}): Object {
      const style = rule(props, renderer)
      const reference = JSON.stringify(style)

      if (!renderer.cache.hasOwnProperty(reference)) {
        const processedStyle = processStyleWithPlugins(
          renderer,
          rule(props, renderer),
          RULE_TYPE,
          props
        )

        renderer.cache[reference] = StyleSheet.create({
          style: processedStyle,
        })

        renderer._emitChange({
          type: RULE_TYPE,
          style: processedStyle,
        })
      }
github robinweser / fela / packages / fela-monolithic / src / index.js View on Github external
renderer.renderRule = (rule: Function, props: Object = {}): string => {
    const processedStyle = processStyleWithPlugins(
      renderer,
      rule(props, renderer),
      RULE_TYPE,
      props
    )
    return renderer._renderStyleToClassNames(processedStyle, rule)
  }