Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defcssfn don't behave as documented #170

Open
wolfgangshilei opened this issue Feb 3, 2019 · 2 comments
Open

defcssfn don't behave as documented #170

wolfgangshilei opened this issue Feb 3, 2019 · 2 comments

Comments

@wolfgangshilei
Copy link

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.

@wolfgangshilei wolfgangshilei changed the title css and defcssfn don't behave as documented defcssfn don't behave as documented Feb 3, 2019
@noprompt
Copy link
Owner

noprompt commented Feb 4, 2019

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.

@wolfgangshilei
Copy link
Author

Thank you for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants