concept selector inheritance in category css

appears as: selector inheritce
Sass and Compass in Action

This is an excerpt from Manning's book Sass and Compass in Action.

With a little planning, selector inheritance is a nice way to keep your Sass DRY and your CSS lean. Now that you’ve seen how Sass helps you avoid repeating yourself, in the next section you’ll see what Compass brings to the table.

2.6. Trimming CSS with selector inheritance

The final major method for reducing repetition when using Sass is known as selector inheritance. Based on the idea of object-oriented CSS pioneered by Nicole Sullivan, selector inheritance is the ability to tell Sass that one selector should inherit all the styles defined for another selector. This is declared using the @extend-rule.

Listing 2.4. Extending styles with selector inheritance
.error { border: 1px red; background-color: #fdd; } .seriousError { @extend .error; border-width: 3px; }