Open jyggiz opened 3 years ago
In agreement there -it is best practice to place mixins first and separate your mixin(s) and regular declarations with a newline for legibility.
Input on CSS was requested last week and this particular example should definitely live under a SCSS sub-chapter.
While on the topic of adding this to the coding standards, maybe we should also include a section about excessive parenthesis on mixins that do not require any arguments as well?
.caption {
@include copy-1; // Using this notation
font-weight: bold;
}
.caption {
@include copy-1(); // In favor of this
font-weight: bold;
}
I never enforce that concept because it doesn't really help make code more legible or the output smaller.
@xxxxxxx xxxxx();
sticks out way more than @xxxxxxx xxxxx;
I noticed when checking several pull requests that there are cases when mixins are inserted not at the beginning of the selector:
I think it's best practice to include mixins at the very top so that you do not accidentally overwrite the styles you wrote earlier. We also need to add a new line after the mixin to improve the reading of the code. Example:
I think it would be nice to add this to the coding standards if it really is best practice. I noticed that we do not have a section with rules for CSS or is it better to add this rule somewhere else?