Instead of having a tree-like structure for includes and styles for each appearance selector, there is now a flat list for each appearance selector. This makes extending and overwriting of style definitions much easier and much more reliable, because this way, we can make sure, that styles are applied in the correct order (meaning: First the styles from the root theme and then all styles from all derived themes, if there are any).
Additional Features
(some already introduced in earlier commits)
Multiple inheritance: A theme can now have multiple parent themes
Multiple includes: A style can now include multiple other styles
Note
Whenever a style is requested, the style is resolved in the following order (see examples below for details about includes and style functions):
All includes are processed recursively (i.e. if the included style has one or several includes, they are processed, too)
All style functions are executed
Examples
Single theme
Let's say we have a single theme called 'Base' with the following style definitions:
Let's say, we have a theme called 'Derived', which includes the 'Base' theme from above. In that theme, we have, among others, the following style definitions:
Instead of having a tree-like structure for includes and styles for each appearance selector, there is now a flat list for each appearance selector. This makes extending and overwriting of style definitions much easier and much more reliable, because this way, we can make sure, that styles are applied in the correct order (meaning: First the styles from the root theme and then all styles from all derived themes, if there are any).
Additional Features (some already introduced in earlier commits)
Note Whenever a style is requested, the style is resolved in the following order (see examples below for details about includes and style functions):
Examples
Single theme
Let's say we have a single theme called 'Base' with the following style definitions:
After the theme was parsed, we end up with a style definition like this:
Multiple themes
Let's say, we have a theme called 'Derived', which includes the 'Base' theme from above. In that theme, we have, among others, the following style definitions:
After the theme was parsed, we end up with a style definition like this:
The style definition for 'button.blue' in the 'Derived' theme would override the style definition for 'button.blue' in the 'Base' theme.
Clear previous styles
Let's say you want to remove any previously applied styles, e.g. those from a base theme. You just need to provide an empty object for that.