An Argument for Elm/Html

Good article!

Yeah, I personally decided against Elm UI myself because I remember looking at it once and remembering it lacked really fine controls I want to use (like for instance, forcing browsers to style inputs and render graphics the exact way I want them to) and also because I wanted to keep my CSS knowledge fresh (I am hesitant about Tailwind for this reason too). But for simpler applications or folks who are not like, extremely deep into CSS, it makes sense.

And yeah, maintaining elm-css is very much a constantly moving target. I spent many hours writing tens of thousands of lines of code to update functionality of the original elm-css package to phantom types and it’s still not a complete successor. I’m personally fine writing property "height" "fit-content" when something doesn’t fit but I understand if it feels like it starts defeating the point, especially if you find you have to do that a lot.

After many years of personal experience with CSS (either by itself or with a preprocessor), I personally decided I did not want to write CSS again without some serious guardrails, so elm-css works well enough for me for now. It allows me to get closer to the Elm ideal of writing a web application and walking away.

My main qualm with elm-css right now is that stylesheet compilation happens at runtime instead of build time (I know there has been some talk about fixing this, but only ideas and proof of concepts so far.)

Yeah, this is a pretty tough problem with elm-css. I maintain a package for handling screen size metrics that can’t help but depend on it. And I inevitably I forget to update until I realise I can’t update elm-css without pushing an update to this package. -.- I think this is made even worse by the fact that elm-css depends on forking elm/html, which means Html stuff is in a bad place too. (I wonder if perhaps this situation could be improved by splitting the Html.Styled and the Css stuff into separate packages…)

FWIW, I am very much open for PRs on my fork of elm-css, it might take me a couple of weeks to check it, but it will get seen and merged.

2 Likes