Skip to content

Instantly share code, notes, and snippets.

@kisai
Created December 9, 2014 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kisai/f2c9c4de0fde40f64f63 to your computer and use it in GitHub Desktop.
Save kisai/f2c9c4de0fde40f64f63 to your computer and use it in GitHub Desktop.
Extend hiccup syntax for css style attribute
;; taken from http://stackoverflow.com/questions/12679754/idiomatic-way-of-rendering-style-info-using-clojure-hiccup
(defn style [& info]
{:style (.trim (apply str (map #(let [[kwd val] %]
(str (name kwd) " " val "; "))
(apply hash-map info))))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment