Sass
%icon { transition: background-color ease .2s; margin: 0 .5em; } .error-icon { @extend %icon; /* error specific styles... */ } .info-icon { @extend %icon; /* info specific styles... */ }
Output
.error-icon, .info-icon { transition: background-color ease .2s; margin: 0 .5em; } .error-icon { } .info-icon { }
Note
Placeholder selectors have an additional property that they will not be displayed in the generated CSS, only those who extend them will be included in the output.
Additional Information
http://thesassway.com/intermediate/understanding-placeholder-selectors
Instruments
If you want to play Sass, use - http://sassmeister.com/
source share