... | ... | @@ -18,16 +18,24 @@ Structure |
|
|
|
|
|
|
|
|
#### Wrong
|
|
|
|
|
|
- Multiple selectors are on the same line
|
|
|
- The closing brace isn't left-aligned with the opening selector
|
|
|
- `.selector-4` has 2 property-value pairs on a single line. Only a single pair is allowed for shorthand single-line declarations.
|
|
|
|
|
|
```
|
|
|
.selector-1, .selector-2, .selector-3 {
|
|
|
background: #fff;
|
|
|
color: #000;
|
|
|
}
|
|
|
|
|
|
.selector-1 { background: #fff; color: #000; }
|
|
|
.selector-4 { background: #f00; color: #000; }
|
|
|
```
|
|
|
|
|
|
#### Good
|
|
|
|
|
|
- There are multiple property-value pairs, so aligning the colon characters could help readability.
|
|
|
|
|
|
```
|
|
|
.selector-1,
|
|
|
.selector-2,
|
... | ... | @@ -38,6 +46,7 @@ Structure |
|
|
```
|
|
|
|
|
|
#### Best
|
|
|
|
|
|
```
|
|
|
.selector-1,
|
|
|
.selector-2,
|
... | ... | @@ -45,4 +54,4 @@ Structure |
|
|
background : #fff;
|
|
|
color : #000;
|
|
|
}
|
|
|
``` |
|
|
``` |
|
|
\ No newline at end of file |