Property merging
Property merging is useful if properties accept a
Comma Separated Value (CSV). You will find this type of property mostly in CSS3, where borders, backgrounds, and transitions accept a CSV list. However, you will also find that the old-school font-family
parameter accepts a list of font names that are separated by commas. Properties are merged by adding a plus sign (+
) after their names, as shown in the following code:
.alternative-font() { font-family+: Georgia,Serif; } .font() { font-family+: Arial; .alternative-font; } body { .font; }
This code will get compiled into the following code:
body { font-family: Arial, Georgia,Serif; }