Stylable scope enables you to wrap several style-rules using a single directive. The scoping directive receives any valid Stylable selector to use for its scoping.
Stylable scoping directive is similar in its behavior to CSS nesting, but can only be applied to a single level.
There are many possible patterns that can be used to theme a site or application in CSS. Stylable scoping capability serves as syntax sugar to allow an easier theme implementation.
Below are several examples for how theming can be done.
In this example, we're representing a dark theme as a stylesheet. Creating your overriding rules under that Stylesheet's symbol and apply it to the relevant part of your DOM.
In this theme implementation we are targeting three components and overriding their default look.
In this example, we are extending our previously created dark theme, with a specific override for the Gallery component.
In this file, we are creating pre-designed flavors that uses Stylable variables to determine their styling.
In this example, we use our existing flavors from above to customize our components look under the dark theme.