在Clojurescript中客户端是否有用于操作CSS的lib? [英] Is there a lib for manipulating CSS on the client side in Clojurescript?

查看:166
本文介绍了在Clojurescript中客户端是否有用于操作CSS的lib?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在客户端上制作新的CSS规则,例如进行CSS转换。显然jQuery有这样的东西,但是在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 ?

我发现Gaka和Garden在服务器端生成了像Hiccup那样的CSS,但是如果我想在客户端做动态CSS?

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 ?

Enlive,Dommy或其中任何一个Clojurescript lib这样做?

Does Enlive, Dommy or any of those Clojurescript libs do that ?

推荐答案

查看 jayq

您可以通过简单内置 css wrapper 和一个Clojure地图:

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

这篇关于在Clojurescript中客户端是否有用于操作CSS的lib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆