This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-08
Channels
- # admin-announcements (19)
- # announcements (1)
- # beginners (70)
- # boot (192)
- # braid-chat (55)
- # cider (3)
- # cljs-dev (42)
- # cljsjs (2)
- # cljsrn (25)
- # clojars (23)
- # clojure (162)
- # clojure-brasil (3)
- # clojure-czech (18)
- # clojure-russia (10)
- # clojurecup (3)
- # clojurescript (63)
- # code-reviews (6)
- # community-development (340)
- # core-async (7)
- # cursive (4)
- # datomic (20)
- # events (2)
- # funcool (3)
- # hoplon (20)
- # jobs (33)
- # ldnclj (11)
- # lein-figwheel (9)
- # leiningen (6)
- # off-topic (1)
- # om (79)
- # proton (4)
- # re-frame (39)
- # ring-swagger (4)
- # slack-help (2)
- # yada (2)
I'm having trouble getting functions from these (css) color libs, working within hlisp.... https://github.com/noprompt/garden/wiki/Color#introduction https://github.com/thi-ng/color#example-usage
They work fine inside a garden.clj file, but not in my .hl file (inside a defelem....?)
I've tried (div :css (cell= {:background-color (color/hsl 0 50 50)}))
to no avail
for [garden.color :as color]
Any suggestions?
@chromalchemy: I dont see any cell’s in your formula cell
Do I need to use cells to run the (color/hsl) function as an attribute value, even if it doesn't vary at runtime?
formula cells are for changing attribute values when a cell gets a value change
I was trying the functions within a defelem (which I am using for html fragments), maybe that was the problem?
..but that should be able to work no? Setting up a custom element with attributes derived from other functions...
yes, i dont know that the :css
attribute works that way tho
i have only ever used it for class names
I would convert your css to a string and use it for a :style
attribute
:style (clojure.string/join [“background-color:” (color/hsl 0 50 50) “;"])
im sure there are better ways
Thanks, I'll try that! Can you use that approach with a map of multiple rules?
all you are doing is appending to a string with that approach, you can add as many segments as you like
Ok, thanks again, I'll play around with that.
btw do I need to attest to some kind of contributor agreement?