RuleDSL
Part of the DSL (Domain Specific Language) for building Themes.
A theme contains top-level rules in the form :
SELECTOR { ... }
...
is a block of code with RuleDSL as the receiver (i.e. this is RuleDSL
)
Within the block, you can define property values :
"PROPERTY_NAME" ( PROPERTY_VALUE )
There are also convenience methods for common properties. e.g. :
textColor( color )
Which is equivalent to :
"textColor" ( color )
You can also define sub-rules :
child(SELECTOR) { ... }
descendant(SELECTOR) { ... }
SELECTOR { ... }
The new rule's selector will be either a ChildSelector, DescendantSelector or an AndSelector.
In the first two cases SELECTOR
can be a String
or a Selector. In the last case, it can also be an enum which implements WithPseudoStyle. e.g.
Orientation.HORIZONTAL { ... }
In this example, the rule matches a node if the Node's pseudoStyles
contains the String ":horizontal". It is NOT checking the node's orientation property.
Functions
Used by ButtonBar
Used by Labelled
Example
Example
For the 'root' selector.
Used by SpinnerBase