As more and more developers use SASS, it is necessary to pay attention to the number of SASS code. We can explain some special features of SASS syntax based on the CSS (Cascading Style Sheet). After all, CSS style guides are very common.
This article mainly introduces some features that I am more interested in, which may benefit you from them and form your own SASS usage guide.
Continue to keep your usual CSS format rules and style guideThis article focuses on some content about SASS, but on this basis, developers should maintain their own and good format rules. If you have not developed a set of format rules of your own, here are some reviews of style guides that should help you form your own CSS writing habits. Here are only some of the contents included:
1. Keep row indentation consistent
2. Keep the number of spaces before and after colon/braces
3. Keep one selector per line, one rule per line
4. Try to write the relevant attributes together
5. For class name naming rules, one plan
6. Avoid using CSS id selector
7. Wait
Next, let’s learn how to write beautiful SASS code, taking writing a property of a .weather class as an example:
First list @extend(s)
CSS Code Copy content to clipboard