Selectors decide which elements that USS rules affect.
USS supports a set of simple selectors that are analogous, but not identical, to simple selectors in CSS. A simple selector matches elements by element type, USS class, element name, and wildcard.
You can combine simple selectors into complex selectors, or append pseudo-classes to them to target elements in specific states. USS supports descendant, child, and multiple complex selectors.
|Match elements based on their element types.
|Match elements based on the name of an element.
|Match elements that have specific USS classes assigned.
|Match any element.
|Match elements that are descendants of another element in the visual treeAn object graph, made of lightweight nodes, that holds all the elements in a window or panel. It defines every UI you build with the UI Toolkit.
See in Glossary.
|Match elements that are children of another element in the visual tree.
|Select elements that match all the simple selectors.
|Create a comma-separated list of selectors that share the same style rule.
|Use pseudo-classes with selectors to target elements that are in a specific state.
|Understand USS precedence when multiple USS rules target the same elements.