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 !!