mirror of
https://github.com/thangisme/notes.git
synced 2024-09-27 16:26:01 -04:00
.. | ||
README.md |
at-extend-no-missing-placeholder
Disallow at-extends (@extend
) with missing placeholders.
Using a class selector with the @extend
directive usually results in more generated CSS than when using a placeholder selector. Furthermore, Sass specifically introduced placeholder selectors in order to be used with @extend
.
See Mastering Sass extends and placeholders.
.foo {
@extend %bar
// ↑
// This is a placeholder selector
}
The following patterns are considered warnings:
p {
@extend .some-class;
}
p {
@extend #some-identifer;
}
p {
@extend .blah-#{$dynamically_generated_name};
}
The following patterns are not considered warnings:
p {
@extend %placeholder;
}
p {
@extend #{$dynamically_generated_placeholder_name};
}