Styles should not be inserted into HEAD in Safari
See original GitHub issue- Operating System: OSX
- Node Version: does not matter
- NPM Version: does not matter
- webpack Version: does not matter
- mini-css-extract-plugin Version: does not matter
Expected Behavior
Expected that application behaviour would be the same across different browsers.
Actual Behavior
In Safari
the whole rendering would be suspended while style
, added to the head
, is loading.
Adding style
to the body
resolves the problem.
Code
This example reproduces an issue originally created for loadable-components.
It delays serving for .css
file for 10 second, and all this time nothing is rendered.
How Do We Reproduce?
- add
link
to thehead
in Safary - render some animation (like counter) in on the page
- page is expected to be fronzen all time
link
is loading the data
How to fix?
For Safari “dynamic” styles has to be added into Body
. It resolves the issue.
- ongoing PR https://github.com/webpack-contrib/mini-css-extract-plugin/pull/459 should fix the problem, however it should be considered as a default behavior.
- I would say that’s a WebKit bug, but could not find something at their bug tracker
- see this PR for a bit more context
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
css style tag is not evaluated in safari
Try using <style type="text/css"> @media and screen (min-resolution: 1dppx) { .trailer { background-image: ...
Read more >Add and remove headers and footers in Pages on Mac
To set header or footer behavior for each section, click the Section tab at the top of the Document sidebar, then choose any...
Read more >Customize your Safari settings on iPad
In the Safari app , you can customize your start page, change the text size on websites, and change display and privacy settings....
Read more >Configuring Web Applications
Conceptual information and techniques on creating effective web content for Safari and WebKit using HTML, JavaScript, and CSS.
Read more >Customize the Safari browser window on Mac
If you see angle brackets at the right end of the toolbar, it means the window is too small to show all of...
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 Free
Top 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
inserting styles to
<header>
is a common practice, it is definitely shouldn’t be changedI would say - it might take a year to resolve this issue via webkit, so some other solution should be created.