This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-07
Channels
- # adventofcode (62)
- # babashka (88)
- # beginners (52)
- # boot (2)
- # bristol-clojurians (1)
- # calva (7)
- # cider (15)
- # circleci (4)
- # clj-kondo (12)
- # cljdoc (5)
- # cljsrn (4)
- # clojure (53)
- # clojure-dev (1)
- # clojure-spec (7)
- # clojure-uk (7)
- # clojurescript (25)
- # core-async (14)
- # duct (1)
- # emacs (10)
- # figwheel-main (3)
- # fulcro (11)
- # garden (14)
- # jobs (1)
- # klipse (2)
- # luminus (1)
- # malli (9)
- # re-frame (6)
- # reagent (13)
- # remote-jobs (1)
- # shadow-cljs (124)
- # sql (1)
- # testing (15)
- # tools-deps (13)
- # uncomplicate (1)
- # vim (1)
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"}])
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
(ns todomvc.css
(:require [garden.def :refer [defstyles]]))
(defstyles screen
[:body {:color "red"}]
)
and then
lein garden once
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.