4 ms·
you don't necessarily have to duplicate code blocks all the time since you can declare a definition for multiple styles: .uno { color: green; font-si
by treyp 16y ago
you don't necessarily have to duplicate code blocks all the time since you can declare a definition for multiple styles:
.uno {
color: green;
font-size: 18px;
text-align: center;
}
.dos {
color: green;
font-size: 18px;
}
can become
.uno, .dos {
color: green;
font-size: 18px;
}
.uno {
text-align: center;
}
also, as others have pointed out, nesting is kind of there in the form of a hierarchy. child elements will get parent styles for most properties.
- chriseppstein 16y agoSass provides inheritance to accomplish this same result but without spreading your selectors all over the place. .uno { @extend .dos; text-align: center; } .dos { color: green; font-size: 18px; }