Created
December 9, 2014 19:20
-
-
Save kisai/f2c9c4de0fde40f64f63 to your computer and use it in GitHub Desktop.
Extend hiccup syntax for css style attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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