Tailwind css is not working on Safari browser #178629
-
BodyHello everyone, I recently built a website using Next.js and Tailwind CSS. The site works perfectly across all browsers except Safari 18. When I open it in Safari, many of the layouts appear broken. I initially suspected an issue with WebKit, but after checking, the code seems fine. When I open the Developer Tools in Safari and navigate to the CSS file in the It seems like the styles are not being fully loaded or applied at first. Thank you in advance! 🙏 Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
|
The Next.js GitHub issue: “Turbopack Not Compiling Tailwind CSS Changes in Safari” reports Tailwind + Next causing style issues in Safari. Blog on debugging Tailwind CSS with Next.js: “Debugging Tailwind CSS and Next.js” on LogRocket; good for catching config / loading issues. Reddit post: Tailwind v4 causing layout break on Safari (specifically forms input styles); shows browser‑specific quirks. |
Beta Was this translation helpful? Give feedback.
-
Community Experience:
What you should try next:
If you provide your |
Beta Was this translation helpful? Give feedback.
-
|
There are several potential issues and considerations with your Tailwind CSS and Next.js configuration, especially regarding Safari compatibility. Few things to check 😃 1. CSS Variable Usage in Tailwind Config ColorsYou’re using Tailwind custom colors like: border: "hsl(var(--border))",
input: "hsl(var(--input))",
...This means your CSS uses variables (
What to check:
2. Advanced Animation and KeyframesYour config uses custom keyframes and animation: keyframes: { "accordion-down": ... }
animation: { "accordion-down": ... }Potential issue:
3. Minification/PostcssYour plugins: { tailwindcss: {}, autoprefixer: {} }But Safari sometimes mishandles minified files—disable minification or try a production build with full CSS (without minification) to test. 4. Import Paths for Tailwind’s
|
Beta Was this translation helpful? Give feedback.
-
|
v4 relies more on CSS variables (--color-name) instead of static JS-defined palettes used in v3. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

There are several potential issues and considerations with your Tailwind CSS and Next.js configuration, especially regarding Safari compatibility. Few things to check 😃
1. CSS Variable Usage in Tailwind Config Colors
You’re using Tailwind custom colors like:
This means your CSS uses variables (
--border, etc.) declared inglobals.css.Potential issue:
var(--something)) well, especially inside HSL/Color functions or if the variable is undefined at the time of style application.