This gist may be your full solution or just the starting point for making your Tailwind v4 projects backwards compatible.
- Convert
@property
rules into good old CSS vars - Pre-compute
oklab()
functions - Pre-compute
color-mix()
functions (+ replace CSS vars inside them beforehand) - Remove advanced instructions (colorspace) from gradients
- Provide support for nested CSS (used by dark mode or custom variants with
&
) - Transform
translate
,scale
,rotate
properties to theirtransform: ...
notation - Add whitespace to var fallbacks
var(--var,)
>var(--var, )
to help older browsers understand