Cheatsheet
CSS Terminology
- selector: query to target elements in the DOM
- property: Name of the declaration (e.g. color)
- declaration: CSS property paired with a value
- declaration Block: List of CSS declarations
- ruleset: CSS declaration block paired with a selector
See MDN How CSS is structured and css-tricks Ruleset Terminology for detailed explanation of CSS naming and structure.
Syntax
Syntax that is unique to Stylable or extended from CSS.
Selectors
Syntax | Explanations |
---|---|
| Class selector (api) |
| Element type selector (api) |
| Pseudo-class or custom state selector (api) |
| Pseudo-element or custom-element selector (api) |
| custom selector (api) |
| disables selector namespacing (api) |
Module system
Syntax | Explanations |
---|---|
| Import stylesheet's root (api) |
| Import named exports (api) |
| Import default & named (api) |
| Local alias for named import (api) |
| Import keyframes (api) |
| Import layers (api) |
| Import containers (api) |
Class extensions
Syntax | Explanations |
---|---|
| Extend an existing class (api) |
| Define custom pseudo-classes (api) |
Templating
Syntax | Explanations |
---|---|
| Build time variables definition (api) |
| Insert var value into declaration (api) |
| Computed value from custom formatter (api) |
| Apply multiple mixins to CSS ruleset (api) |
| Apply mixins with override params (api) |
Other
Syntax | Explanations |
---|---|
| Scope nested rules with a given selector (api) |
| Development display name for debugging (api) |