Fork me on GitHub
#re-frame
<
2018-06-30
>
hoopes19:06:42

How does one do something like change a css class on <body>? The app is mounted inside the body tag by default - is there another way to mount the app than the default index.html that comes with the re-frame template? Do I do something like getElementsByTagName('body') and work directly on the element?

hoopes19:06:58

(from within an event handler, i guess?)

manutter5120:06:50

Are you sure you need to put the class on the body tag itself? You can't use a div inside that contains everything?

manutter5120:06:19

but yeah, if you need the body tag, I'd say getElementsByTagName and JS interop would be the way to go.

manutter5120:06:52

Also, to be really pure, I'd implement that in an effect handler, since you're basically setting state outside of the re-frame app itself.

hoopes20:06:08

right on - thanks. and yeah, i can probably lean on the designer a little bit 🙂