garden
garden copied to clipboard
defcssfn don't behave as documented
Environment: [garden "1.3.6"] [org.clojure/clojure "1.8.0"] [org.clojure/clojurescript "1.10.238"]
Problem: garden.def/defcssfn does not function as documented.
Details: Expected results (as documented):
(defcssfn url)
;; => #'user/url
(url "http://fonts.googleapis.com/css?family=Lato")
;; => #garden.types.CSSFunction{:function "url", :args "http://fonts.googleapis.com/css?family=Lato"}
(css (url "http://fonts.googleapis.com/css?family=Lato"))
;; => url(http://fonts.googleapis.com/css?family=Lato)
Actual results:
(defcssfn url)
;; => #'user/url
(url "http://fonts.googleapis.com/css?family=Lato")
;; => {:f "url", :args ("http://fonts.googleapis.com/css?family=Lato")}
(css (url "http://fonts.googleapis.com/css?family=Lato"))
;; => ""
Could you please help explain this discrepancy?
Thank you.
The documentation is just wrong. It looks like CSSFunction is only rendered with css when it's in a rule. I think at one point that did work but — and it's been so long now I can't remember — a change must have caused that to stop working (though I have no idea now what that change was). I think the example call to css could probably be discarded.
Thank you for the clarification.