extractCritical doesn't extract css from <Global> components
See original GitHub issueCurrent behavior:
extractCritical
doesn’t extract css from <Global>
components.
Some applications, like for example Google AMP, cannot have multiple <style>
tags and/or cannot have <style>
tags rendered in the <body>
.
To reproduce:
- Use
extractCritical
to extract the CSS from the React app - Inject that CSS in it’s own <style amp-custom> in the <head>
Expected behavior:
The <style amp-custom>
tag is fine, but there’s an additional tag
<style data-emotion-css="xxx">
with the css from the <Global>
component.
The CSS from <Global>
should be extracted as well.
Environment information:
react
version: 16.8.6emotion
version: 10.0.14
I’ll add a codesandbox with the production soon (cloudflare seems down right now).
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Server Side Rendering - Emotion
If you have dynamic global styles it's advised to create cache per single render to avoid global styles from different renders leaking into...
Read more >Extract critical CSS - web.dev
Critical CSS is a technique that extracts the CSS for above-the-fold content in order to render content to the user as fast as...
Read more >Separating CSS - SurviveJS
Webpack provides a means to generate a separate CSS bundles using mini-css-extract-plugin (MCEP). It can aggregate multiple CSS files into one. For this...
Read more >@emotion/server | Yarn - Package Manager
Extract and inline critical css with emotion for server side rendering. ... to the css prop, a Global component for dynamic global styles,...
Read more >@egoist/vue-emotion - npm
Seamlessly use emotion (CSS-in-JS) with Vue.js. Latest version: 0.6.2, last published: 2 years ago. Start using @egoist/vue-emotion in your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thank you very much @luisherranz ! now I can use emotion with my AMP pages!
@luisherranz
Sorry for my stupidity, but I couldn’t use @emotion-js on AMP pages with Next.js. Could you help me with an example?