How to use the fela-dom/lib/dom/rehydration/rehydrateCache function in fela-dom

To help you get started, we’ve selected a few fela-dom 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 / benchmark / rule-optimisation / cases / rehydrated.js View on Github external
const rule = ({ fontSize, width }) => {
    if (!renderer.cache[0]) {
      renderer.cache = {
        ...renderer.cache,
        ...rehydrateCache(
          '.a{background-color:black}.b{line-height:1}.c:hover:{color:red}'
        ),
        ...rehydrateCache(
          '.d{background-color:yellow}.e{color:green}',
          '(min-width: 300px)'
        ),
        [0]: {
          type: 'COMPILATION'
        }
      }
    }

    return {
      _className: 'a b c d e',
      fontSize: `${fontSize}px`,
      width: `${width}px`,
github robinweser / fela / benchmark / rule-optimisation / cases / rehydrated.js View on Github external
const rule = ({ fontSize, width }) => {
    if (!renderer.cache[0]) {
      renderer.cache = {
        ...renderer.cache,
        ...rehydrateCache(
          '.a{background-color:black}.b{line-height:1}.c:hover:{color:red}'
        ),
        ...rehydrateCache(
          '.d{background-color:yellow}.e{color:green}',
          '(min-width: 300px)'
        ),
        [0]: {
          type: 'COMPILATION'
        }
      }
    }

    return {
      _className: 'a b c d e',
      fontSize: `${fontSize}px`,
      width: `${width}px`,
      ':hover': {
        width: `${width * 2}px`,
        '@media (min-width: 300px)': {

fela-dom

Fela package for working with the DOM

MIT
Latest version published 1 year ago

Package Health Score

81 / 100
Full package analysis