github emotion-js/emotion @emotion/cache@11.6.0

latest releases: @emotion/css@11.13.4, @emotion/utils@1.4.1, @emotion/serialize@1.3.2...
2 years ago

Minor Changes

  • #2521 516fe458 Thanks @mnajdova! - Added insertionPoint option to the createCache. It can be used to insert rules after the specified element. For example, to use it with the CacheProvider from @emotion/react you can do this:

    const head = document.querySelector('head')
    
    // <meta name="emotion-insertion-point" content="">
    const emotionInsertionPoint = document.createElement('meta')
    emotionInsertionPoint.setAttribute('name', 'emotion-insertion-point')
    emotionInsertionPoint.setAttribute('content', '')
    
    head.appendChild(emotionInsertionPoint)
    
    // the emotion sheets should be inserted right after the meta tag
    const cache = createCache({
      key: 'my-app',
      insertionPoint: emotionInsertionPoint
    })
    
    function App() {
      return (
        <CacheProvider value={cache}>
          <Main />
        </CacheProvider>
      )
    }

Patch Changes

  • Updated dependencies [9e82a991]:
    • @emotion/sheet@1.1.0

Don't miss a new emotion release

NewReleases is sending notifications on new releases.