Sub topic 8
Check browser support
This chapter assumes you have a working Vite project with Tailwind CSS v4 installed and verified, as covered in the earlier chapters. You should also know basic CSS and be comfortable opening browser developer tools.
Why browser support matters in v4
Tailwind v4 is built on modern CSS features. Earlier versions mostly generated plain CSS that worked in older browsers. Version 4 relies on newer platform features, so some browsers can no longer render its output correctly.
The official minimum targets are:
| Browser | Minimum version |
|---|---|
| Safari | 16.4 |
| Chrome | 111 |
| Firefox | 128 |
These versions matter because v4 uses features such as @property (registered custom properties), color-mix(), and cascade layers (@layer). Older browsers do not support them. The result is not a build error. The page loads, but parts of the styling are missing or wrong.
Check the Tailwind documentation for the current list before you commit to a support policy, because these numbers can change between releases.
What you can and cannot fix
Your build tool does not give you a way to polyfill these features. Vite builds your JavaScript for a target you choose, and its default build target already matches the browsers above. Changing build.target affects how JavaScript and some CSS syntax are compiled. It does not add support for @property or color-mix() in a browser that lacks them.
You can see Vite's default target in vite.config.ts. This config sets it explicitly. It uses the same values Vite documents as its modern default:
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
build: {
target: 'baseline-widely-available',
},
})Leaving build.target out gives the same result in current Vite versions. Setting it makes your intent visible to the next person reading the file.
Checking support in practice
Use this sequence before shipping:
- Decide which browsers your users actually use. Your analytics are a better guide than general market data.
- Compare those browsers with the minimum versions above.
- Test in the oldest browser you intend to support. Open the dev server URL, or a production preview, and look at the heading from the verification chapter.
- If the heading is unstyled or colors look wrong, open developer tools and look for rules that the browser discards as invalid.
You can also test support for a single feature directly in the browser console:
console.log({
property: CSS.supports('syntax: "<color>"') || typeof CSS.registerProperty === 'function',
colorMix: CSS.supports('color', 'color-mix(in srgb, red, blue)'),
})Both values should be true. If either is false, that browser cannot render Tailwind v4 output reliably.
Common mistakes
- Assuming a successful build means the page works everywhere. The build only checks your files, not the browser that loads the result.
- Testing only in the latest Chrome. Problems show up in older Safari and Firefox releases, such as iOS devices that cannot update.
- Trying to fix missing styles by changing
build.target. That setting does not supply the missing CSS features.
Exercise
A teammate says the Tailwind v4 build passes, but a customer on Chrome 105 sees broken colors and missing styles. What is the likely cause, and what are your two options?
Show answer
Chrome 105 is below the v4 minimum of Chrome 111, so it lacks CSS features v4 relies on, such as @property and color-mix(). The build passes because the tools only process your files and do not check the browser. Your options are to raise the supported browser floor so the customer must update, or to stay on Tailwind v3.4. Changing build.target does not fix it.