Hi, what's the most common way of using garden? Do you define all the styles inline using the css function?
(css [:body {:font-size "16px"}])
or is there a way to create css classes?
I found a macro names defstyles but I'm not sure how to use it
also defstylesheet
do you have a file full of defs like this:
(def body (css [:body {:font-size "16px"}]))
@nmkip I mainly use it to create my CSS file, using the defstylesheet macro. You can definitely create CSS classes. I’m on my phone right now, but should be near my computer and can post an example if you can’t figure it out before then
It’s really flexible, so if there’s a specific workflow you want to use it should be possible to get it working
Ahh
you create a clojure file to define a css file
(ns todomvc.css
(:require [garden.def :refer [defstyles]]))
(defstyles screen
[:body {:color "red"}]
)
and then
lein garden once
for example
Yeah, that’s a good way to do it! It works in CLJS as well - I’m generating my CSS file in CLJS and injecting it into my page so that I can hot reload it with figwheel (I’m using deps.edn and didn’t want to figure out a replacement for lein garden). I can write up how to do that if it sounds useful.
Yes, later when you are near your computer 🙂 Thanks!! I prefer using deps.edn but reframe's github led me to lein hehehe
Yeah, most of the work in garden was done well before deps.edn existed, and re-frame is pretty straightforward to get setup in deps.edn as well.