Nesting depth 5 greater than max of 4 Open
&:hover,
- Read upRead up
- Exclude checks
Nesting Depth
Rule nesting-depth
will enforce how deeply a selector can be nested.
Options
-
max-depth
: number (defaults to2
)
Examples
When enabled (assuming max-depth: 2
) the deepest element (&:hover
and &--modifier
) are at at depth 2. Any nested selector deeper is disallowed:
.foo {
.baz {
&:hover {
// Deepest Nest Allowed
}
}
}
.block {
&__element {
&--modifier {
// Deepest Nest Allowed
}
}
}
Nesting depth 5 greater than max of 4 Open
&:hover,
- Read upRead up
- Exclude checks
Nesting Depth
Rule nesting-depth
will enforce how deeply a selector can be nested.
Options
-
max-depth
: number (defaults to2
)
Examples
When enabled (assuming max-depth: 2
) the deepest element (&:hover
and &--modifier
) are at at depth 2. Any nested selector deeper is disallowed:
.foo {
.baz {
&:hover {
// Deepest Nest Allowed
}
}
}
.block {
&__element {
&--modifier {
// Deepest Nest Allowed
}
}
}
Nesting depth 5 greater than max of 4 Open
&:after {
- Read upRead up
- Exclude checks
Nesting Depth
Rule nesting-depth
will enforce how deeply a selector can be nested.
Options
-
max-depth
: number (defaults to2
)
Examples
When enabled (assuming max-depth: 2
) the deepest element (&:hover
and &--modifier
) are at at depth 2. Any nested selector deeper is disallowed:
.foo {
.baz {
&:hover {
// Deepest Nest Allowed
}
}
}
.block {
&__element {
&--modifier {
// Deepest Nest Allowed
}
}
}
Nesting depth 5 greater than max of 4 Open
&:after {
- Read upRead up
- Exclude checks
Nesting Depth
Rule nesting-depth
will enforce how deeply a selector can be nested.
Options
-
max-depth
: number (defaults to2
)
Examples
When enabled (assuming max-depth: 2
) the deepest element (&:hover
and &--modifier
) are at at depth 2. Any nested selector deeper is disallowed:
.foo {
.baz {
&:hover {
// Deepest Nest Allowed
}
}
}
.block {
&__element {
&--modifier {
// Deepest Nest Allowed
}
}
}
Space expected between blocks Open
> a.su-link--external {
- Read upRead up
- Exclude checks
Empty Line Between Blocks
Rule empty-line-between-blocks
will enforce whether or not nested blocks should include a space between the last non-comment declaration or not.
Options
-
include
:true
/false
(defaults totrue
) -
allow-single-line-rulesets
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
allow-single-line-rulesets
When allow-single-line-rulesets: true
, the following are allowed. When allow-single-line-rulesets: false
, the following are disallowed:
.foo { content: 'foo'; }
.bar { content: 'bar'; }
.baz { content: 'baz'; }
Space expected between blocks Open
&:after {
- Read upRead up
- Exclude checks
Empty Line Between Blocks
Rule empty-line-between-blocks
will enforce whether or not nested blocks should include a space between the last non-comment declaration or not.
Options
-
include
:true
/false
(defaults totrue
) -
allow-single-line-rulesets
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
allow-single-line-rulesets
When allow-single-line-rulesets: true
, the following are allowed. When allow-single-line-rulesets: false
, the following are disallowed:
.foo { content: 'foo'; }
.bar { content: 'bar'; }
.baz { content: 'baz'; }
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Space expected between blocks Open
&:after {
- Read upRead up
- Exclude checks
Empty Line Between Blocks
Rule empty-line-between-blocks
will enforce whether or not nested blocks should include a space between the last non-comment declaration or not.
Options
-
include
:true
/false
(defaults totrue
) -
allow-single-line-rulesets
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
content: 'foo';
.bar {
content: 'bar';
// Waldo
&--baz {
content: 'baz';
}
}
}
allow-single-line-rulesets
When allow-single-line-rulesets: true
, the following are allowed. When allow-single-line-rulesets: false
, the following are disallowed:
.foo { content: 'foo'; }
.bar { content: 'bar'; }
.baz { content: 'baz'; }
Type-selector should be nested within its parent Class Open
.ds-entity--stanford-person .stanford-person a {
- Read upRead up
- Exclude checks
Force Element Nesting
Rule force-element-nesting
will enforce the nesting of elements
Examples
When enabled, the following are disallowed:
div p {
content: '';
}
.parent {
&__child h1 {
content: '';
}
}
a[target="_blank"] span {
content: '';
}
When enabled, the following are allowed:
div {
p {
content: '';
}
}
.parent {
&__child {
h1 {
content: '';
}
}
}
a[target="_blank"] {
span {
content: '';
}
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Class should be nested within its parent Type-selector Open
> a.su-link--external {
- Read upRead up
- Exclude checks
Force Element Nesting
Rule force-element-nesting
will enforce the nesting of elements
Examples
When enabled, the following are disallowed:
div p {
content: '';
}
.parent {
&__child h1 {
content: '';
}
}
a[target="_blank"] span {
content: '';
}
When enabled, the following are allowed:
div {
p {
content: '';
}
}
.parent {
&__child {
h1 {
content: '';
}
}
}
a[target="_blank"] {
span {
content: '';
}
}
No trailing whitespace allowed Open
}
- Read upRead up
- Exclude checks
No Trailing Whitespace
Rule no-trailing-whitespace
will enforce that trailing whitespace is not allowed.
Examples
When enabled, the following are disallowed (\s denotes spaces or tabs):
.foo {\s
margin: 1.5rem;
}
.foo {
margin: .5rem;\s
}
.foo {
margin: .4rem;
}\s
No trailing whitespace allowed Open
&:focus {
- Read upRead up
- Exclude checks
No Trailing Whitespace
Rule no-trailing-whitespace
will enforce that trailing whitespace is not allowed.
Examples
When enabled, the following are disallowed (\s denotes spaces or tabs):
.foo {\s
margin: 1.5rem;
}
.foo {
margin: .5rem;\s
}
.foo {
margin: .4rem;
}\s
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Type-selector should be nested within its parent Class Open
.stanford-people-grid .views-row .views-field-title a {
- Read upRead up
- Exclude checks
Force Element Nesting
Rule force-element-nesting
will enforce the nesting of elements
Examples
When enabled, the following are disallowed:
div p {
content: '';
}
.parent {
&__child h1 {
content: '';
}
}
a[target="_blank"] span {
content: '';
}
When enabled, the following are allowed:
div {
p {
content: '';
}
}
.parent {
&__child {
h1 {
content: '';
}
}
}
a[target="_blank"] {
span {
content: '';
}
}
No trailing whitespace allowed Open
}
- Read upRead up
- Exclude checks
No Trailing Whitespace
Rule no-trailing-whitespace
will enforce that trailing whitespace is not allowed.
Examples
When enabled, the following are disallowed (\s denotes spaces or tabs):
.foo {\s
margin: 1.5rem;
}
.foo {
margin: .5rem;\s
}
.foo {
margin: .4rem;
}\s
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Class should be nested within its parent Class Open
.ds-entity--stanford-person .stanford-person a {
- Read upRead up
- Exclude checks
Force Element Nesting
Rule force-element-nesting
will enforce the nesting of elements
Examples
When enabled, the following are disallowed:
div p {
content: '';
}
.parent {
&__child h1 {
content: '';
}
}
a[target="_blank"] span {
content: '';
}
When enabled, the following are allowed:
div {
p {
content: '';
}
}
.parent {
&__child {
h1 {
content: '';
}
}
}
a[target="_blank"] {
span {
content: '';
}
}
No trailing whitespace allowed Open
color: $su-color-digital-blue;
- Read upRead up
- Exclude checks
No Trailing Whitespace
Rule no-trailing-whitespace
will enforce that trailing whitespace is not allowed.
Examples
When enabled, the following are disallowed (\s denotes spaces or tabs):
.foo {\s
margin: 1.5rem;
}
.foo {
margin: .5rem;\s
}
.foo {
margin: .4rem;
}\s
Qualifying elements are not allowed for class selectors Open
> a.su-link--external {
- Read upRead up
- Exclude checks
No Qualifying Elements
Rule no-qualifying-elements
will enforce that selectors are not allowed to have qualifying elements.
Options
-
allow-element-with-attribute
:true
/false
(defaults tofalse
) -
allow-element-with-class
:true
/false
(defaults tofalse
) -
allow-element-with-id
:true
/false
(defaults tofalse
)
Examples
By default, the following are disallowed:
div.foo {
content: 'foo';
}
ul#foo {
content: 'foo';
}
input[type='email'] {
content: 'foo';
}
allow-element-with-attribute
When allow-element-with-attribute: true
, the following are allowed. When allow-element-with-attribute: false
, the following are disallowed.
input[type='email'] {
content: 'foo';
}
a[href] {
content: 'foo';
}
allow-element-with-class
When allow-element-with-class: true
, the following are allowed. When allow-element-with-class: false
, the following are disallowed.
div.foo {
content: 'foo';
}
h1.bar {
content: 'foo';
}
allow-element-with-id
When allow-element-with-id: true
, the following are allowed. When allow-element-with-id: false
, the following are disallowed.
ul#foo {
content: 'foo';
}
p#bar {
content: 'foo';
}
Pseudo-elements must start with double colons Open
&:after {
- Read upRead up
- Exclude checks
Pseudo-element
Rule pseudo-element
will enforce that:
- Pseudo-elements must start with double colons.
- Pseudo-classes must start with single colon.
Examples
When enabled, the following are allowed:
.foo::before {
content: "bar";
}
.foo:hover {
content: "bar";
}
When enabled, the following are disallowed:
.foo:before {
content: "bar";
}
.foo::hover {
content: "bar";
}
Class should be nested within its parent Class Open
.stanford-people-grid .views-row .views-field-title a {
- Read upRead up
- Exclude checks
Force Element Nesting
Rule force-element-nesting
will enforce the nesting of elements
Examples
When enabled, the following are disallowed:
div p {
content: '';
}
.parent {
&__child h1 {
content: '';
}
}
a[target="_blank"] span {
content: '';
}
When enabled, the following are allowed:
div {
p {
content: '';
}
}
.parent {
&__child {
h1 {
content: '';
}
}
}
a[target="_blank"] {
span {
content: '';
}
}