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: README.md
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -54,13 +54,6 @@ When using multiple selectors, every individual selector should have its own lin
54
54
}
55
55
```
56
56
57
-
There are some exceptions to this rule as well, for example, when you combine ultra-short selectors in a single line:
58
-
59
-
```css
60
-
h2, .h2 {
61
-
...
62
-
}
63
-
```
64
57
65
58
### Whitespace
66
59
@@ -171,9 +164,23 @@ Don't forget to comment module elements as well:
171
164
...
172
165
}
173
166
```
174
-
175
167
If you don't get the syntax/terminology above, don't worry - there's a whole section dedicated to BEM below.
176
168
169
+
Remember to use the syntax above to write a comment before a set of rules and not `//`. We use double slash only for inline comments (see below).
170
+
171
+
```
172
+
/*
173
+
Use this type
174
+
*/
175
+
.candidate {
176
+
...
177
+
}
178
+
179
+
// Instead of this
180
+
.candidate {
181
+
...
182
+
}
183
+
177
184
#### Use inline comments for extras
178
185
179
186
Preprocessor (inline) comments can be used to specify the use of a specific declaration. They can be useful to denote todos or add quick tips for your future self.
@@ -186,6 +193,7 @@ Preprocessor (inline) comments can be used to specify the use of a specific decl
186
193
187
194
Again, don't worry about going overboard with commenting, since comments and whitespace are removed during minification and aren't visible in production.
188
195
196
+
189
197
### Why not use IDs?
190
198
191
199
It might make sense to use an ID for a unique part of the page but believe me, you want to avoid it. Using IDs for styling increases the selector specificity immensely. If you want to override that styling at some point you have to use another ID (and probably nest it) or just slap `!important` on it and hope for the best.
0 commit comments