Use two spaces per indentation level.
Bad: four spaces
p {
color: #f00;
}Good: two spaces
p {
color: #f00;
}You can configure this linter to prefer tabs if you like.
For projects that follow BEM, you may prefer to allow arbitrary indentation for rule sets that aren't nested in order to give the visual hints of hierarchy without actually nesting selectors (which has a performance cost). For example:
.component {}
.component__image {}
.component__text {}
.component-subblock {}
.component-subblock__text {}
.component-category {}
.component-other {}You can set allow_non_nested_indentation to true if this convention is
preferred.
| Configuration Option | Description |
|---|---|
allow_non_nested_indentation |
Whether non-nested rule sets can be arbitrarily indented (default false) |
character |
tab or space (default space) |
width |
Number of characters per indentation level (default 2) |