Fork me on GitHub
#rum
<
2020-05-14
>
didibus05:05:58

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

jeroenvandijk06:05:43

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

didibus06:05:21

I mean scoped to the component

didibus06:05:45

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

jeroenvandijk06:05:04

What’s the difference between that and inline styles?

didibus06:05:03

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

jeroenvandijk06:05:50

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

didibus06:05:54

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

jeroenvandijk06:05:29

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

jeroenvandijk06:05:34

from the top of my head πŸ™‚

jeroenvandijk06:05:41

might be {:color "blue"}

jeroenvandijk06:05:18

you can also do it without garden, with plain text

didibus06:05:24

Hum, that seems easy enough

jeroenvandijk06:05:36

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

didibus06:05:03

I might start with that, thanks

πŸ‘ 4
roman01la08:05:15

:style value should be a map, not a string

πŸ‘Œ 4
roman01la08:05:36

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

roman01la08:05:08

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

roman01la08:05:32

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