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.Can you elaborate?
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 ,,,)
yeah, that works and looks better
(pr-str ". . hd hd hd hd hd hd ."
"sd sd sd main main main main main main"
"sd sd sd ft ft ft ft ft ft")
Awesome!
Heh, I didn’t know you could pass multiple args to pr-str
. 😄
yeah, i just dropped the vector as, yeah cool right! thank you very much sir! 🙂