This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-31
Channels
- # announcements (4)
- # babashka (73)
- # beginners (128)
- # bristol-clojurians (1)
- # calva (8)
- # cider (8)
- # clj-kondo (4)
- # clojars (7)
- # clojure (148)
- # clojure-dev (16)
- # clojure-europe (5)
- # clojure-gamedev (1)
- # clojure-italy (10)
- # clojure-nl (7)
- # clojure-uk (57)
- # clojurescript (57)
- # clojutre (1)
- # community-development (2)
- # cursive (7)
- # data-science (1)
- # datascript (5)
- # datomic (9)
- # events (6)
- # figwheel-main (1)
- # fulcro (91)
- # garden (11)
- # graalvm (14)
- # graphql (1)
- # immutant (4)
- # jobs (1)
- # kaocha (33)
- # off-topic (63)
- # onyx (3)
- # pathom (4)
- # re-frame (23)
- # ring-swagger (1)
- # shadow-cljs (49)
- # sql (6)
- # testing (8)
- # tools-deps (45)
- # vrac (1)
- # xtdb (10)
anyone know how to write the garden clojurescript for grid-areas? in css they look like:
grid-template-areas:
". . hd hd hd hd hd hd ."
"sd sd sd main main main main main main"
"sd sd sd ft ft ft ft ft ft";
i tried something like:
:grid-template-areas
[". . hd hd hd hd hd hd ."
"sd sd sd main main main main main main"
"sd sd sd ft ft ft ft ft ft"]
but no dice.well see the plain css one is three strings, terminated by a semi-colon... I'm not sure how to express three strings in clojurescript... tried putting them in a vector...but...
I think I can just escape the double quotes like so:
[:.wrapper
{
:display "grid"
:grid-template-areas
"
\". . hd hd hd hd hd hd .\"
\"sd sd sd main main main main main main\"
\"sd sd sd ft ft ft ft ft ft\"
"
}]
I see. I’m not familiar with this. Another, perhaps more robust, way to do that would be to use pr-str
.
(defn grid-template-areas [areas]
{:grid-template-areas (reduce str (map pr-str areas))})
where areas
are the strings in the vectors you gave.If you need them separated somehow you can use clojure.string/join
instead of (reduce str ,,,)