Skip to content

Instantly share code, notes, and snippets.

View alexanderbuhler's full-sized avatar
💭
Solving puzzles, day by day.

Alexander Buhler alexanderbuhler

💭
Solving puzzles, day by day.
View GitHub Profile
@alexanderbuhler
alexanderbuhler / README.md
Last active April 24, 2025 15:06
Tailwind v4 polyfill / browser compatibility configuration

This gist may be your full solution or just the starting point for making your Tailwind v4 projects backwards compatible.

What it does

  • 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 their transform: ... notation
  • Add whitespace to var fallbacks var(--var,) > var(--var, ) to help older browsers understand