Yes, but that should be a lot easier than you might think.
You can import the elm-css variants with import Html.Styled as Html and all your Html.something will work just fine. If all the functions are used without the namespace than it is just a matter of import Html exposing (..) being replaced with import Html.Styled exposing (..).
In other words, the changes you need to do might just be limited to some import refactoring.
I’m having trouble plumbing in this new Html.Styled to my view
import Browser
app : Program () Model Msg
app =
Browser.application
{ init = init
, view = view
...
}
view : Model -> Browser.Document Msg
view model =
{ title = "app title"
, body =
[ div ...
}
The compiler spots the problem:
Type mismatch error.
Expected: `Document Msg`
Found: `{ title : String, body : List (Html Msg) }`
Mismatched fields:
Field `body` expected `List (Html Msg)`, found `List (Html Msg)`Elm
Nope! This is the one place where you need to use toUnstyled to convert from Html.Styled to ordinary Html. Unfortunately, the error message is confusing in this case because of the import alias.
elm-css is now type-checking all my styling code.
It spotted an error where I was using "color" "dark-gray" in my elm app and the browser had been ignoring it — because CSS color names don’t use hyphens.