Created
November 26, 2016 05:45
-
-
Save thedavidmeister/68cf53456c61c37a33331d06008c4940 to your computer and use it in GitHub Desktop.
Basic Hoplon integration with Garden
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
(ns styles.hoplon | |
(:require garden.compiler | |
hoplon.core)) | |
(defmethod hoplon.core/do! :garden | |
[el _ v] | |
; Replace all the inline styles on an element with css generated by Garden. | |
; Obviously does not play nice with other methods of setting inline styles. | |
(let [vs (if (sequential? v) v [v]) | |
css (garden.compiler/compile-style vs)] | |
(.setAttribute el "style" css))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment