A namespace for defining CSS units.
A namespace for defining CSS units.
(defunit unit)
(defunit identifier css-unit)
Creates a unit function which takes 1 argument and creates a CSSUnit record for future compilation. Defunit can take 1 arg: (defunit px) or 2 args: (defunit percent "%").
Usage of the defined units: (px 15) ... compiles to "15px" (percent 33) ... compiles to "33%"
CSSUnits can be added, subtracted, multiplied or divided by using function calc (you can also use these 4 keywords - they are defined just for better search in code: :add, :sub, :mul, :div
E.g. (calc (px 500) :add 3 :mul (vw 5)) ... "calc(500px + 3 * 5vw)".
Creates a unit function which takes 1 argument and creates a CSSUnit record for future compilation. Defunit can take 1 arg: (defunit px) or 2 args: (defunit percent "%"). Usage of the defined units: (px 15) ... compiles to "15px" (percent 33) ... compiles to "33%" CSSUnits can be added, subtracted, multiplied or divided by using function calc (you can also use these 4 keywords - they are defined just for better search in code: :add, :sub, :mul, :div E.g. (calc (px 500) :add 3 :mul (vw 5)) ... "calc(500px + 3 * 5vw)".
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close