Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you add a ":hover" effect on Elm without using signals?

I want to add a :hover style to an element using Elm's HTML library. I could do it using Signals and Sets to keep track of selected nodes, but that would bloat my code with unecessary state for something trivial. I could do it by adding an external stylesheet, but I still didn't figure how to do it using elm-reactor.

So, how can I add a :hover style to an element using Elm?

like image 954
MaiaVictor Avatar asked Jan 26 '26 04:01

MaiaVictor


1 Answers

It looks like the 'identicalsnowflake/elm-dynamic-style' library might help:

http://package.elm-lang.org/packages/identicalsnowflake/elm-dynamic-style/1.1.0

div (hover [("color","blue","lightblue")]) [text "so cool!"]