Extending Styles
A style can extend another style. It inherits all the attributes of the extended style. With this mechanism a lot of writing work can be saved:
.mainScreen {
margin: 10;
font-color: black;
font-size: medium;
font-style: italic;
background-color: gray;
}
.highscoreScreen extends mainScreen {
font-color: white;
background-color: black;
}
In the above example the style "highscoreScreen" inherits all attributes of the "mainScreen" style, but "font-color" and "background-color" are specified differently. Circle inheritance is not allowed, so the following example results in a build error:
.baseScreen extends highscoreScreen { /* this extends is invalid! */
margin: 5;
font-color: white;
}
.mainScreen extends baseScreen {
margin: 10;
font-color: black;
font-size: medium;
font-style: italic;
background-color: gray;
}
.highscoreScreen extends mainScreen {
font-color: white;
background-color: black;
}
The above example would be valid, when the style "baseScreen" would not extend the "highscoreScreen"-style.