You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CSS-SASS.md
+24-8
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,30 @@ A good example is a simple card:
69
69
</div>
70
70
```
71
71
72
+
### Do not use SASS `&__` or `&--`
73
+
74
+
That will make it much harder to debug and find the line of code.
75
+
76
+
```scss
77
+
// Wrong
78
+
.product {
79
+
color: black;
80
+
81
+
&__image {
82
+
opacity: 1;
83
+
}
84
+
}
85
+
86
+
// Right
87
+
.product {
88
+
color: black;
89
+
}
90
+
91
+
.product__image {
92
+
opacity: 1;
93
+
}
94
+
```
95
+
72
96
### Avoid over-qualified selectors by (unnecessary) nesting
73
97
74
98
That means the following code should be avoided. Not only because it produces more code, it also makes it harder to keep track of the parent-children chain, and harder to debug in some cases. The longer the rules, the harder it gets to keep track of the parent when deep nesting is used.
@@ -147,14 +171,6 @@ In slightly more complex situations, blocks can also be elements of other blocks
147
171
}
148
172
```
149
173
150
-
### Use `rem()` when defining custom pixel dimensions
151
-
152
-
```scss
153
-
.block {
154
-
font-size: rem(16px);
155
-
}
156
-
```
157
-
158
174
### Use `media-min` and `media-max` mixins for breakpoints
0 commit comments