Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

Update README.md #2

Merged
merged 1 commit into from
Apr 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ When using multiple selectors, every individual selector should have its own lin
}
```

There are some exceptions to this rule as well, for example, when you combine ultra-short selectors in a single line:

```css
h2, .h2 {
...
}
```

### Whitespace

Expand Down Expand Up @@ -171,9 +164,23 @@ Don't forget to comment module elements as well:
...
}
```

If you don't get the syntax/terminology above, don't worry - there's a whole section dedicated to BEM below.

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).

```
/*
Use this type
*/
.candidate {
...
}

// Instead of this
.candidate {
...
}

#### Use inline comments for extras

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.
Expand All @@ -186,6 +193,7 @@ Preprocessor (inline) comments can be used to specify the use of a specific decl

Again, don't worry about going overboard with commenting, since comments and whitespace are removed during minification and aren't visible in production.


### Why not use IDs?

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.
Expand Down