问题
I want to make new CSS rules on the client, for doing CSS transitions for example. Apparently jQuery has this kind of thing, but what about in the world of Clojurescript ?
I found Gaka and Garden for generating CSS on the server side like Hiccup, but what if I want to do dynamic CSS on the client side ?
Does Enlive, Dommy or any of those Clojurescript libs do that ?
回答1:
Take a look at jayq
You can do CSS manipulation to a DOM element via simple built in css wrapper and a Clojure map:
(ns myapp
(:use [jayq.core :only [$ css inner]]))
(def $interface ($ :#interface))
(-> $interface
(css {:background "blue"})
(inner "Loading!"))
回答2:
Garden works on the client side with ClojureScript. It does virtually everything the "server side" Clojure version does with a few minor exceptions. You can use it to generate or update stylesheets in the browser if that's what you're looking for.
来源:https://stackoverflow.com/questions/16668248/is-there-a-lib-for-manipulating-css-on-the-client-side-in-clojurescript