More compiler guarantees - catch typos in your class names. Elm can't tell you that A.class "mx-uato" is a typo, but it will tell you TW.mx_uato doesn't exist.
Code completion - leverage code completion for Elm to know which tailwind classes are available
How
We create a new postcss plugin that grabs all the classes in your css
For each class we create a new Elm function that looks something like this:
We then write out each of these new functions to create an Elm module that you can import like any other
The Elm module generated with the default Tailwind build is about 900kb, but the Elm compiler removes any functions that are unused: so you don't need to worry about your asset size. It can take a few seconds to compile the module - but this only needs to happen once for every time you change your Tailwind config.
Get Started
Install: yarn add postcss-elm-tailwind
Add require("postcss-elm-tailwind")({ elmFile: "src/TW.elm" }) to your postcss.config.js file