elm-html: unable so set background-color or a <div>?

225 views
Skip to first unread message

Do Bi

unread,
Jul 22, 2014, 8:29:14 AM7/22/14
to elm-d...@googlegroups.com
Hi,

while playing around with elm-html I was unable to set the background color of a <div> element.
My code is as follows: http://www.share-elm.com/sprout/53ce57f0e4b07afa6f9831e7
Since share-elm can not execute it (yet?), here is a screenshot or the result: http://i.imgur.com/VbvoSVt.png
The background stays white. Am I doing something wrong or is this a bug?

Tobias

Jeff Smits

unread,
Jul 22, 2014, 8:35:49 AM7/22/14
to elm-discuss
Hi Tobias,

Perhaps "background-color" is not the JavaScript name for the CSS property? See the docs of the node function, where it says: All HTML attributes and CSS properties must be set using the JavaScript version of their name, so class becomes className, float becomes cssFloat, etc.

--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Do Bi

unread,
Jul 22, 2014, 8:50:04 AM7/22/14
to elm-d...@googlegroups.com
Yes, you are right. In Javascript it is backgroundColor. I used background-color because that is how it is shown in the announcement.
However also with backgroundColor it still does not work.

Jeff Smits

unread,
Jul 22, 2014, 8:54:05 AM7/22/14
to elm-discuss
Then the announcement should be changed.
And I have no idea if you have found a bug or not.

Evan Czaplicki

unread,
Jul 22, 2014, 9:02:37 AM7/22/14
to elm-d...@googlegroups.com
I believe it is a bug. I have observed this as well, but did not want to block on it. Would you open an issue on the repo and bring in @Matt-Esch who will actually know what's going on in virtual-dom (where the problem may originate)?

Evan Czaplicki

unread,
Jul 22, 2014, 9:06:01 AM7/22/14
to elm-d...@googlegroups.com
The workaround is to set that kind of thing in CSS for now.

Do Bi

unread,
Jul 22, 2014, 9:17:10 AM7/22/14
to elm-d...@googlegroups.com

Evan Czaplicki

unread,
Jul 22, 2014, 9:21:22 AM7/22/14
to elm-d...@googlegroups.com
Cool, thank you, and sorry for the trouble!
Reply all
Reply to author
Forward
0 new messages