Specification Overview
CSS Terminology
- Simple selector: Type selector, class selector (+Stylable root class)
- CSS property: Name of the rule (e.g. color)
- CSS declaration: CSS property paired with a value
- CSS declaration Block: List of CSS declarations
- CSS ruleset: CSS declaration block paired with a selector
Stylable
Syntax unique to Stylable - Click each to access code examples and descriptions
- Directive rules
-st-*Instructions for the Stylable pre-processor, removed during transpilation-st-extendsSimple selector base class-st-statesDefine custom pseudo-classes-st-mixinApply mixins to CSS ruleset
- Selectors
:import {}Import external assets like mixins, stylesheets, common CSS and vars-st-fromLocation of file to import-st-defaultImport the file’s default export value-st-namedImport the file’s named export value or values
@namespace "readable name";Development display name for debugging:vars{}Define common values to be used across the stylesheet or project- formatters Custom TypeScript/JavaScript functions for generating declaration values