Charmingly Simple Styling library allows using clojure data structures to define application styles.
It adds JVM-wide support for cljfx-css
URL protocol that can then be used to retrieve
registered style maps as CSS
Charmingly Simple Styling library allows using clojure data structures to define application styles. It adds JVM-wide support for `cljfx-css` URL protocol that can then be used to retrieve registered style maps as CSS
(register id m)
Globally register style map describing CSS with associated keyword identifier
CSS is created by recursively concatenating string keys starting from root to define selectors, while using keyword keys in value maps to define rules, for example:
{".button" {:-fx-text-fill "#ccc"
":hover" {:-fx-text-fill "#aaa"}}}
;; corresponds to this css:
.button {
-fx-text-fill: #ccc;
}
.button:hover {
-fx-text-fill: #aaa;
}
Globally register style map describing CSS with associated keyword identifier CSS is created by recursively concatenating string keys starting from root to define selectors, while using keyword keys in value maps to define rules, for example: ``` {".button" {:-fx-text-fill "#ccc" ":hover" {:-fx-text-fill "#aaa"}}} ;; corresponds to this css: .button { -fx-text-fill: #ccc; } .button:hover { -fx-text-fill: #aaa; } ```
(unwatch key)
Remove a watcher defined by this key
Remove a watcher defined by this `key`
(url id)
Returns an URL string that will load registered style's CSS
Returns an URL string that will load registered style's CSS
(watch key id f)
Add a watch function for id that will receive new URL string and style map whenever a new style map for this id is registered
key
is a watch identifier, using it with different f
or id
will overwrite existing
watch
Add a watch function for id that will receive new URL string and style map whenever a new style map for this id is registered `key` is a watch identifier, using it with different `f` or `id` will overwrite existing watch
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close