To my surprise I couldn’t set CSS variables. The use case is simple: I need to do this in order to use an external CSS framework. “I can do this in Elm” doesn’t apply therefore. The framework is Google’s Material Comonents for the Web.
Now I need to use the very ugly trick of inserting a style node with a unique class name.
Is there any hope Elm will support this in the future? Or a workaround better than this?
Just not understanding why Elm does not support the full CSS spec.
There is debois/elm-mdl library, but I think, it’s still in version 0.18. You can inspire there or if you’re using some builder like Brunch you can write a similar config. (In posted link is for Bulma Css framework.)
@berend I saw your comments on the issue tracker, but for people who are not familiar with the existing tickets I’ve linked them below. The common theme is that it has been considered a feature request rather than a bug, which is incorrect in my view as it is part of the CSS spec and is supported by Edge, Firefox, Safari, Chrome, Opera, iOS Safari, Android, and others.
Unfortunately setting the style directly interferes with cases where the user passes a style. Is there a way to detect if a List (HtmlAttribute m) contains an Html.attribute "style" "..."?