(make m)
Create Style from passed map
Style is a both a map that can be used as a source of style information for desktop application, and a definition of a cascading style sheet
Passed map recursively replaces all vectors in it in a value position with values from
this map using get-in
to reduce repetition in style definition, for example:
(make {:padding {:big 10} ".dialog" {:-fx-padding [:padding :big]}})
=> {:padding {:big 10} ".dialog" {:-fx-padding 10}}
Cascading style sheet is defined by recursively concatenating string keys starting from root to define selectors and then using keyword keys in associated maps to define rules:
((make {".button" {:-fx-text-fill "#aaa" ":hover" {:-fx-text-fill "#ccc"}}}))
=> .button {
-fx-text-fill: #aaa;
}
.button:hover {
-fx-text-fill: #ccc;
}
Style has different invocation semantics:
Create Style from passed map Style is a both a map that can be used as a source of style information for desktop application, and a definition of a cascading style sheet Passed map recursively replaces all vectors in it in a value position with values from this map using `get-in` to reduce repetition in style definition, for example: ``` (make {:padding {:big 10} ".dialog" {:-fx-padding [:padding :big]}}) => {:padding {:big 10} ".dialog" {:-fx-padding 10}} ``` Cascading style sheet is defined by recursively concatenating string keys starting from root to define selectors and then using keyword keys in associated maps to define rules: ``` ((make {".button" {:-fx-text-fill "#aaa" ":hover" {:-fx-text-fill "#ccc"}}})) => .button { -fx-text-fill: #aaa; } .button:hover { -fx-text-fill: #ccc; } ``` Style has different invocation semantics: - when invoked with 0 args, returns it's cascading style sheet as string - when invoked with 1 arg, replaces all vector refs in passed data structure with values from this style map
(register id m)
Globally register Style produced from passed map with associated keyword identifier
Globally register Style produced from passed map with associated keyword identifier
(url id)
Returns an url string that will load associated Style's cascading style sheet
Returns an url string that will load associated Style's cascading style sheet
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close