garden icon indicating copy to clipboard operation
garden copied to clipboard

at-imports not at top of the file

Open danielrs opened this issue 8 years ago • 1 comments

According to this, the @import should be added to the top of the file, but:

(defcssfn url)

(css
    [:body {:font-size "1em"}]
    (at-import (url "http://fonts.googleapis.com/css?family=Josefin+Slab:400,700|Inconsolata:400,700|Raleway:400,400italic,700"))
    [:p {:font-weight "bold"}])

Outputs:

body {
  font-size: 1em;
}

@import url(http://fonts.googleapis.com/css?family=Josefin+Slab:400,700|Inconsolata:400,700|Raleway:400,400italic,700);

p {
  font-weight: bold;
}

Garden should collect this import statements and place them at the top of the output. I'll see if I can do something and create a pull request, I'm kinda new to clojure.

Best regards.

danielrs avatar Mar 14 '16 07:03 danielrs

@DanielRS Ah, I guess I overlooked this part of the spec. It may or may not be trivial to put this to have @import emitted at the top of the file. I'll take a look.

noprompt avatar Mar 14 '16 17:03 noprompt