Skip to content

Instantly share code, notes, and snippets.

@selfsame
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save selfsame/f929d1c20abe60f2dcf6 to your computer and use it in GitHub Desktop.

Select an option

Save selfsame/f929d1c20abe60f2dcf6 to your computer and use it in GitHub Desktop.
css vars
cljs.user=> (require '[fast.core :refer [-o -styles -rules -add]] )
nil
cljs.user=> (require 'css.units)
nil
cljs.user=> (-o 80)
<span.tab>
cljs.user=> (-add (-o 80) "width" "3em")
#<width:3em;>
cljs.user=> (-add (-o 80) "height" "5%")
#<height:5%;>
cljs.user=> (str (-o 80))
"<span class=\"tab\" style=\"width:3em;height:5%;\" >demo/std.html</span>"
cljs.user=> (map (comp css.units/px #(.-value %)) (-rules (-o 80)))
(<48px> <25px>)
cljs.user=> (css.units/div (.-width (-styles (-o 80))) (.-height (-styles (-o 80))))
1.92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment