Safari 13 doesn't apply CSS after resize

Viewed 562

Safari applies my styles normally on page load for any size. However, it won't apply desktop styles if the window has been sized for mobile since at any point since the last reload.

To most easily see/trigger the behavior, open the site in Safari 13 at desktop size and see the desired layout (most notable here is the navigation bar). Resize the browser down to mobile layout (be sure the navigation switches to hamburger mode), then back up to the desktop layout. (You may also load the site at mobile first, then simply widen the window.)

See test case here: https://www.davincilabs.com/

Normal behavior (as on load):

Normal behavior (on load)

After browser resize (Safari 13 only):

Broken after browser resize

If you inspect menu elements, you will see that styles-l.css and navigation-desktop.css apply. After resizing up, the style sheets no longer apply.

IMPORTANT: This does not appear to be a JavaScript problem! The behavior still occurs if you disable JavaScript from the develop menu.

To recap:

  • Found in Safari 13 ONLY. Earlier versions of Safari that we have tested so far do not experience this. Other browsers tested (Chrome, Firefox, Edge) do not experience this.
  • I have only experienced on desktop. This might affect phones as well but it's impossible to reproduce with my test case; I'm not using any breakpoints small enough.
  • Initial page load is always correct
  • Issue triggers when window is enlarged greater than the mobile breakpoint
  • Safari appears to be no longer applying an entire loaded style sheet file (styles-l.css) to the page layout
  • Occurs even with JavaScript shut off

This must be fairly rare as I can't find other occurrences after a lot of searching, but it's affecting multiple sites I am working on. Finally, if you cause Safari to reconsider CSS rules in the inspector, (such as by manually editing the parameters of a media query,) Safari will instantly redraw the page correctly.

1 Answers

I had the same problem. I don't know why but I have this problem just with the store on Magento 2 and with Safari 13. (Also others big e-commerce like The Protein Works, Bulk Powders, sigmabeauty ecc) I fixed it with macOS Catalina 10.15.7 and Safari 14.

Related