To be LIGHT or to be DARK: a theme migration tale with elm-ui

At my company we’ve started a new trip to add a “simple” feature to our Elm web apps based on elm-ui for supporting light and dark themes.

Here a short message for sharing the experience:

At the beginning we were juggling with the code but quickly we realized that adding an “innocent” theme parameter to our code will basically require a full rewrite of everything … we stopped !!

What to do?

Thankfully, we found a beautiful project called elm-ui-with-context developed by miniBill in the same spirit as html-with-context that later was tuned and improved by MackeyRMS and lucamug.

With elm-ui-with-context in place, we just need to change a couple of declarations at the imports and voilà !! … we have a clear path to do our new web apps support light and dark themes and even more.

For more information about this strategy, please visit:

https://package.elm-lang.org/packages/lucamug/elm-ui-with-context/latest/

A very big thank you to miniBill, MackeyRMS, lucamug, mdgriffith and evancz … you rock guys !!

10 Likes

Glad to hear you found a way to do it. Was it hard to move from elm-ui to elm-ui-with-context? Or is the transition to -with-context a simple thing to do?

2 Likes

It was very simple, since Elm is a compiler, we’ve loaded the new elm-ui-with-context and the compiler lead the way for quick and nice refactorings.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.