项目作者: dehli

项目描述 :
JSS in Clojurescript.
高级语言: JavaScript
项目地址: git://github.com/dehli/cljss.git
创建时间: 2017-12-22T18:03:10Z
项目社区:https://github.com/dehli/cljss

开源协议:MIT License

下载


CLJSS

Clojars Project

This is a Clojurescript wrapper of JSS. Please see their
repo for extensive documentation.

Reagent Example

  1. (ns demo.core
  2. (:require [reagent.core :as reagent]
  3. [cljss.core :as cljss]))
  4. (cljss/setup)
  5. (def styles {:container {:color :blue
  6. :font-family :papyrus}
  7. "@media (max-width: 800px)"
  8. {:container {:color :red}}})
  9. (defn- component []
  10. (let [classes (cljss/classes styles)]
  11. [:div {:className (:container classes)}
  12. "Hello, World!"]))
  13. (defn mount-root []
  14. (reagent/render [component]
  15. (.getElementById js/document "reagent-app")))
  16. (defn init []
  17. (mount-root))