rum 2020-05-14

Any rum compatible locally scoped CSS lib? Like if I want to define CSS style which applies to my whole rum component only?

Not specific to Rum, it works with any hiccup like library

I mean scoped to the component

Like something that let me declare styles which only apply to the component inside ClojureScript.

What’s the difference between that and inline styles?

Hum, I'm not sure πŸ˜› Kind of new to CSS

if it has to be soped to component only, i would start with inline styles

Do you have an example of inline style with garden and rum?

[:div {:style (garden/css :color "bluel")} "hello"]

from the top of my head πŸ™‚

might be {:color "blue"}

you can also do it without garden, with plain text

Hum, that seems easy enough

[:div {:style "color: blue"} "hello"]

I might start with that, thanks

πŸ‘ 1

:style value should be a map, not a string

πŸ‘Œ 1

also note that with inline there's no way to declare :hover etc styles

Garden is fine, but might be super slow if you are building something interactive

aaand in inline styles map you can use keyword values {:color :blue} so that your IDE can help you with autocompletion later πŸ™‚