garden

2018-02-25T08:28:12.000072Z

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

2018-02-25T08:28:44.000024Z

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

2018-02-25T08:30:59.000066Z

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)"

2018-02-25T08:31:50.000026Z

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

2018-02-25T08:32:38.000074Z

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

2018-02-25T08:34:21.000072Z

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

levitanong 2018-02-25T16:23:05.000041Z

@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)

๐Ÿ‘ 2
2018-02-25T16:24:01.000005Z

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

2018-02-25T16:25:10.000005Z

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

levitanong 2018-02-25T16:26:12.000087Z

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.

2018-02-25T16:32:50.000117Z

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