Set syle to body tag using elm-css

I’ve past the last 3 days trying to set background-color to body section without using external css and I’ve been unsuccessful on this. every time I google it, or search on the docs, I find functions supposedly to set this, but once elm is functional, I know none of them should be called on global scope or would make sense to set a global state even if I could call them. can someone give me an example of how to do it properly? not even on the repo for elm-css I found any example showing how to do it

thanks in advance

Here’s an example in Ellie https://ellie-app.com/pGzjYbq7Mbba1. This doesn’t use elm-css, but does what you need.

2 Likes

In elm-css, you want to use

[ Css.backgroundColor color ]
  |> Css.Global.body
  |> Css.Global.global
3 Likes

I appreciate the solution that uses “pure” elm once it teaches me what the library may actually do and also increase my understanding of the language in general. thank you

that’s exactly what I was trying to get. thank you, dta

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