matheus23 / elm-tailwind-modules

Generate Elm code for Tailwind Utilities and Components that purges using Elm's dead code elimination!
https://matheus23.github.io/elm-tailwind-modules/
117 stars 12 forks source link

Tailwindcss 3.3.0 breaks generated elm code (through from|to|via utilities) #25

Closed nidico closed 1 year ago

nidico commented 1 year ago

Tailwind 3.3.0 introduced new from-x%|to-x%|via-x% utility classes which break the generated elm code in both elm-tailwind-modules 0.4.1 and 0.5.0-alpha5.

The invalid generated elm code looks like this:

from_0% : Css.Style
from_0% =
    Css.property "--tw-gradient-from-position" "0%"

Unfortunately, package.json currently allows updates to ^3.1.6 (semver compatible to 3.1.6) which includes 3.3.x, so (as long as this isn't properly fixed) intermediate releases with pinned tailwindcss < 3.3 could be a quick fix. Otherwise users of the library can just locally pin tailwindcss to e.g. 3.2.7.

matheus23 commented 1 year ago

Good catch. This needs to be fixed here: https://github.com/matheus23/elm-tailwind-modules/blob/f3bb237baafa52b1252f819b65409df436ad6680/src/helpers.ts#L24-L50