Selector Inheritance
While CSS3 supports the Document Object Model (DOM) hierarchy, it does not allow selector inheritance. Inheritance is done by inserting a line inside of a code block that uses the @extend keyword and references another selector. The extended selector's attributes are applied to the calling selector.
.error { border: 1px #f00; background: #fdd; } .error.intrusion { font-size: 1.3em; font-weight: bold; } .badError { @extend .error; border-width: 3px; }Would compile to:
.error, .badError { border: 1px #f00; background: #fdd; } .error.intrusion, .badError.intrusion { font-size: 1.3em; font-weight: bold; } .badError { border-width: 3px; }Sass supports multiple inheritance.
Read more about this topic: Sass (stylesheet Language)
Famous quotes containing the word inheritance:
“I call it our collective inheritance of isolation. We inherit isolation in the bones of our lives. It is passed on to us as sure as the shape of our noses and the length of our legs. When we are young, we are taught to keep to ourselves for reasons we may not yet understand. As we grow up we become the men who never cry and the women who never complain. We become another generation of people expected not to bother others with our problems.”
—Paula C. Lowe (20th century)