简体   繁体   中英

Is there a lib for manipulating CSS on the client side in Clojurescript?

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 ?

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!"))

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM