Skip to content

Commit

Permalink
Expand on ruling about targeting elements as selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
pigeonfresh committed Oct 14, 2021
1 parent 2e545c3 commit b446041
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,24 @@ h1, h2, h3 {

Don't use ids as a selector (unless there is no other option)

Don't combine element types with classes and ids
```css
Don't combine element types with classes and ids. Preferably don't style on elements at all. Reasonable exceptions are in a base reset or when styling elements that can not be targeted in another way (e.g. elements that are generated from a wysiwyg editor or coming from external sources).
```scss
/* Recommended */
.overview {}

/* Encouraged exceptions */
.wysiwyg {
h1,
h2,
h3 {
text-transform: uppercase;
}
}

/* Not recommended */
ul.overview {}

.overview li {}
```

Selectors are separated by empty lines
Expand Down

0 comments on commit b446041

Please sign in to comment.