noprompt / garden

Generate CSS with Clojure
1.34k stars 87 forks source link

Write an @supports block #165

Open lambdam opened 6 years ago

lambdam commented 6 years ago

Hello,

I tried to translate this piece of CSS to Garden but couldn't figure out how to do :

@supports ((position: -webkit-sticky) or (position: sticky)) {
  .sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
  }
}

This comes from the Dashboard example from Bootstrap 4 (in dashboard.css)

Is there a general way to write a block like this :

@<name> (<conditions>) {
  <rules>
}

Meanwhile I cheated with

(str
  (css ...)
  (clojure.string/replace "@supports ..." #"\s*" "")
  (css ...))

Thank you very much

zerg000000 commented 5 years ago

should be good enough for showing all the use case

https://github.com/noprompt/garden/blob/2b5cde3b938c58412cb06415fa503e25d319bc9b/test/garden/compiler_test.cljc#L120