canonical
Version:
Canonical code style linter and formatter for JavaScript, SCSS, CSS and JSON.
30 lines (22 loc) • 475 B
Markdown
# Nesting Depth
Rule `nesting-depth` will enforce how deeply a selector can be nested.
## Options
* `max-depth`: number (defaults to `2`)
## Examples
When enabled (assuming `max-depth: 2`) the deepest element (`&:hover` and `&--modifier`) are at at depth 2. Any nested selector deeper is disallowed:
```scss
.foo {
.baz {
&:hover {
// Deepest Nest Allowed
}
}
}
.block {
&__element {
&--modifier {
// Deepest Nest Allowed
}
}
}
```