Fork me on GitHub
#garden
<
2018-02-25
>
benzap08:02:12

@levitanong Unfortunately no, I just want to convert the internal garden representation of a color into it's respective css value representation

benzap08:02:44

garden.compiler/render-value appears to be the entry point to converting the values back to their respective css counterparts

benzap08:02:59

ex. (garden.compiler/render-value (garden.color/rgba 16 64 16 0.5)) would produce the equivalent css value --> "rgba(16, 64, 16, 0.5)"

benzap08:02:50

the cljs counterpart that i'm using doesn't appear to check on whether the methods are private, so i'm happily using render-value on the clojurescript side of things

benzap08:02:38

however, i'd love to be able to use it directly in my stylesheet when creating certain aspects of it, for DRY-sake, i'm forced to put in a lot of magic numbers where i'd rather not put them

benzap08:02:21

on the clojurescript side i'm using render-value to work with rum, since the attribute :style won't accept a string, so garden.core/style is out of the question, which leaves me to using garden.compiler/render-value

levitanong16:02:05

@benzap oh, fascinating. You mean to say that you are attempting to use garden to populate the :style attr of a component? (to my knowledge, the behavior you described is a react thing, rather than a rum thing. So om, fulcro, reagent are all affected)

benzap16:02:01

Yep, that's what I mean đŸ™‚

benzap16:02:10

I'm guessing it's any react implementation that uses sablono under the hood

levitanong16:02:12

That’s an interesting use-case, and one that I had wished for on more than one occasion. But i had resigned myself into thinking that this is for making css style sheets, rather than naked styles. Maybe Joel will see this and consider the use case, or elucidate the lack of support.

benzap16:02:50

well, I feel like it was an intended use-case to include within html, but it just doesn't play well with the sablono map-attr styling. Maybe if he introduced another method specifically for sablono :style attributes? Essentially all it would need to do is leave out the step in fully generating a string, and just render the values in the map