What workaround or code can be used to fix the bug on Safari in Webflow?

TL;DR
  • Identify Safari-specific rendering issues using Web Inspector.  
  • Apply vendor-prefixed and Safari-targeted CSS (e.g., -webkit-), or use media query hacks for Safari-only styles.  
  • Use JavaScript to detect Safari and apply style fixes conditionally.  
  • Implement known CSS fixes for common Safari bugs like sticky or animation glitches.  
  • Simplify complex interactions and animations when necessary for better performance.

Safari may render Webflow elements incorrectly due to browser-specific rendering issues or unsupported features. You can apply targeted workarounds using CSS or JavaScript to improve compatibility.

1. Identify the Specific Bug

  • Test your site on Safari (including iOS and macOS) to pinpoint the issue—e.g., flexbox misalignment, sticky not working, or animations breaking.
  • Use Safari’s Web Inspector (Right-click → Inspect Element) to diagnose styling issues or JS errors.

2. Use WebKit-Specific CSS Fixes

  • Add vendor prefixes or properties targeting Safari’s engine.
  • Common CSS fixes for Safari include:
  • Use -webkit- prefixes (e.g., -webkit-transform-webkit-mask-image).
  • Add backface-visibility: hidden to fix animation glitches.
  • Use min-height: 0; or overflow: hidden; within flexbox children to fix layout bugs.

3. Add Safari-Specific CSS via Custom Code

  • Wrap targeted CSS in a media query hack to isolate Safari:

<style>
   @media not all and (min-resolution: 0.001dpcm) { 
     @supports (-webkit-appearance:none) {
       /* Safari-only CSS */
       .your-element {
         transform: translateZ(0);
       }
     }
   }
</style>

4. Use JavaScript to Detect Safari and Apply Fixes

  • Place JavaScript in Before </body> tag in Page Settings or Project Settings → Custom Code:

if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
  document.querySelectorAll('.your-element').forEach(function(el) {
    el.style.transform = 'translateZ(0)';
  });
}

  • This conditionally applies fixes only when Safari is detected.

5. Known Fixes for Common Safari Bugs

  • Sticky not working: Ensure the parent has height: 100% and add will-change: transform.
  • Text shift on hover: Add -webkit-font-smoothing: antialiased;.
  • Image or background glitches: Force hardware acceleration using transform: translate3d(0, 0, 0);.

6. Minimize Complex Interactions

  • Safari sometimes fails to render layered Lottie animations or heavy interactions smoothly.
  • Consider using simplified animations or replace key animations with CSS transitions.

Summary

To fix Safari-specific bugs in Webflow, use vendor-prefixed CSSmedia query hacks, or user-agent–based JavaScript. Identify the issue clearly, then apply targeted workarounds that isolate Safari behavior without affecting other browsers.

Rate this answer

Other Webflow Questions