4 ms·
I think doing it with SASS makes it cleaner when there are some differences between p and footer. So, instead of this CSS: p, footer { margin-bottom: 2
by toggle 13y ago
I think doing it with SASS makes it cleaner when there are some differences between p and footer. So, instead of this CSS:
p, footer {
margin-bottom: 20px;
font-size: 14px;
line-height: 1.5;
}
p {
text-align: justify;
}
footer {
border: 1px solid black;
}
You could do this SASS:
@mixin default-type {
margin-bottom: 20px;
font-size: 14px;
line-height: 1.5;
}
p {
@include default-type;
text-align: justify;
}
footer {
@include default-type;
border: 1px solid black;
}
I like that last one better. It's like everything that describes what the footer looks like can be contained in the single footer block, rather than having many parts of your stylesheet apply to the footer and saying "this applies to both p and footer."