question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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?

  1. add link to the head in Safary
  2. render some animation (like counter) in on the page
  3. 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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ogonkovcommented, Jan 17, 2020

inserting styles to <header> is a common practice, it is definitely shouldn’t be changed

1reaction
theKasheycommented, Jan 12, 2020
  1. Yes. That’s a purely webkit bug
  2. Also yes… it would take some time to resolve it, as well to release a new version, and ship an update.

I would say - it might take a year to resolve this issue via webkit, so some other solution should be created.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found