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

To help you get started, we’ve selected a few fela-tools 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 / native / createRenderer.js View on Github external
renderRule(rule: Function, props: Object = {}): Object {
      const style = rule(props)
      const reference = JSON.stringify(style)

      if (!renderer.cache.hasOwnProperty(reference)) {
        const processedStyle = processStyleWithPlugins(
          renderer,
          style,
          RULE_TYPE
        )
        renderer.cache[reference] = StyleSheet.create({
          style: processedStyle
        })
      }

      return renderer.cache[reference].style
    }
  }
github robinweser / fela / packages / fela / src / enhancers / monolithic.js View on Github external
renderer.renderRule = (rule: Function, props: Object = {}): string => {
    const processedStyle = processStyleWithPlugins(
      renderer,
      rule(props),
      RULE_TYPE
    )
    return renderer._renderStyleToClassNames(processedStyle, rule)
  }