CSS is being displayed on page shortly before being hidden
See original GitHub issueCurrent behavior:
The CSS is being displayed within the page before being hidden. (flash)
Here’s the content that’s being displayed:
<style data-emotion="css 1s3l8we" data-s="">.css-1s3l8we{margin:0 45px 0 45px;position:absolute;cursor:pointer;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;}.css-1s3l8we:focus{outline:none;}.css-1s3l8we .label{cursor:default;}@media (max-width: 991.98px){.css-1s3l8we{width:100%;-webkit-box-pack:left;-ms-flex-pack:left;-webkit-justify-content:left;justify-content:left;margin:0;}.css-1s3l8we .label{margin-left:25px;}.css-1s3l8we .stamps,.css-1s3l8we .links,.css-1s3l8we .contact,.css-1s3l8we .column-divider{display:none;}}</style>
It’s been happening for months, it’s not something new.
To reproduce:
Happens only within my private app and I don’t know what’s causing this, can’t reproduce it.
Go to https://tfp-sc1-2l-1c-xp-37wm0wymn-unly.vercel.app/en/solutions displays the flash. Lowering the network speed (Console Network settings) makes the transition a bit slower.
Expected behavior:
It shouldn’t display the CSS on the page
Environment information:
react
version: 17.0.1@emotion/react
version: 11.1.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
content-visibility | CSS-Tricks
The content-visibility property in CSS indicates to the browser whether or not an element's contents should be rendered at initial load time ...
Read more >content-visibility - CSS: Cascading Style Sheets | MDN
The content-visibility CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of ...
Read more >javascript - Hide div on page but div shows before being hidden
Set the div's display to none with CSS, not Javascript. Then change the display property with Javascript when you want it to be...
Read more >CSS Layout - The display Property - W3Schools
display: none ; is commonly used with JavaScript to hide and show elements without deleting and recreating them. Take a look at our...
Read more >CSS in Action - Invisible Content Just for Screen Reader Users
display:none or visibility: hidden ... These styles will hide content from all users. The content is removed from the visual flow of the...
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
Not all selectors are validated right now - the detection could definitely be improved there. The logic for it is here: https://github.com/emotion-js/emotion/blob/71ca9be3368ddb0a95ef5b2db7a97c67ab440593/packages/cache/src/stylis-plugins.js#L133
Using
instead of
fixed the issue.