-
Notifications
You must be signed in to change notification settings - Fork 5
Supported CSS Selectors
Since Codename One stylesheets are meant to be used with Codename One component hierarchies instead of XML/HTML documents, selectors work a little differently.
-
All selectors (with some specific exceptions discussed below) are interpreted as UIIDs.
-
Only 4 predefined CSS classes are supported:
-
.pressed- Targets the component when in "Pressed" state. -
.selected- Targets the component when in "Selected" state. -
.unselected- Targets the component when in "Unselected" state. -
.disabled- Targets the component when in "Disabled" state.If no class is specified, then the selector targets "all" states of the given component.
Examples:
-
Button { …. }- Defines styles for the "Button" UIID. -
Button.pressed { … }- Defines styles for the "Button" UIID’s "pressed" state. -
Button, TextField, Form { … }- Defines styles for the "Button", "TextField", and "Form" UIIDs.