Type-selector should be nested within its parent Class Open
.c-sidebar-nav-item i {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.breadcrumbs a:hover {
- 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: '';
}
}
Class should be nested within its parent Class Open
.breadcrumbs .active {
- 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: '';
}
}
Class should be nested within its parent Class Open
.c-sidebar-nav-dropdown-items .c-sidebar-nav-item i {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
!important not allowed Open
background: $white !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Pseudo-class should be nested within its parent Class Open
.c-sidebar-nav-link:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 1.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
!important not allowed Open
fill: $highlight-colour !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Class should be nested within its parent Pseudo-class Open
.c-sidebar-nav-link.c-active:hover .c-sidebar-nav-icon {
- 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: '';
}
}
!important not allowed Open
padding: 0.4em !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
!important not allowed Open
background: $highlight-colour !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Type-selector should be nested within its parent Class Open
.c-sidebar-nav-dropdown-items .c-sidebar-nav-item i {
- 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: '';
}
}
!important not allowed Open
color: $highlight-colour !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Pseudo-class should be nested within its parent Type-selector Open
.breadcrumbs a:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Don't include leading zeros on numbers Open
padding: 0.5em 1em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Class Open
.table-striped .ui-sortable-handle {
- 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: '';
}
}
Type-selector should be nested within its parent Type-selector Open
.table-striped td label {
- 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: '';
}
}
Duplicate properties are not allowed within a block Open
display: flex;
- Read upRead up
- Exclude checks
No Duplicate Properties
Rule no-duplicate-properties
will enforce that duplicate properties are not allowed within the same block.
Options
-
exclude
:[array of property names to be excluded from this rule]
(defaults to empty array[]
)
Examples
When enabled, the following are disallowed:
.foo {
margin: 0 0 15px;
margin: 0;
}
Exclude
When a property is added to the exclude array as shown below then you may place duplicate properties immediately after one another, this is to prevent accidental duplication of properties.
no-duplicate-properties:
- 1
-
exclude:
- display
When display
is added to the exclude array the following would be allowed:
.display-block {
display: flex;
display: inline-block;
float: right;
}
When display
is added to the exclude array the following would still be disallowed as the duplicate properties are separated by another property:
.display-block {
display: flex;
float: right;
display: inline-block;
}
Class should be nested within its parent Class Open
.pager .active .page-link,
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
main .textverylong {
- 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: '';
}
}
Attribute values should be surrounded by quotes Open
main [type=submit]:hover,
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Type-selector should be nested within its parent Type-selector Open
main fieldset {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Pseudo-class should be nested within its parent Type-selector Open
.c-sidebar-footer a:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Class should be nested within its parent Type-selector Open
form .ui-sortable-handle {
- 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-class should be nested within its parent Class Open
.ui-sortable-handle:active {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Type-selector should be nested within its parent Class Open
.table-striped tr {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding-left: 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Class Open
.table-striped .longer {
- 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: '';
}
}
Don't include leading zeros on numbers Open
margin: 0.5em 1px 0.1em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
margin: 0.2em 0.2em 0.2em 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Type-selector Open
main .textshort {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 1.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active:hover .c-sidebar-nav-icon {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
font-size: 0.8em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Type-selector should be nested within its parent Type-selector Open
main label {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.dropdown-menu a:active {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.table-striped td [type=checkbox] {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
main .textveryshort {
- 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: '';
}
}
Attribute values should be surrounded by quotes Open
main [type=button]:hover,
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Qualifying elements are not allowed for class selectors Open
table.elements {
- 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';
}
Vendor prefixes should not be used Open
display: -webkit-flex;
- Read upRead up
- Exclude checks
No Vendor Prefixes
Rule no-vendor-prefixes
will enforce that vendor prefixes are not allowed to be used.
List of prefixes affected by default: * webkit * moz * ms
Options
-
additional-identifiers
:[array of additional prefixes to check for]
(defaults to empty array[]
) -
excluded-identifiers
:[array of prefixes to exclude checking for]
(defaults to empty array[]
) -
ignore-non-standard
:true
:false
(defaults tofalse
)
Examples
When enabled, the following are disallowed:
@-webkit-keyframes anim {
0% { opacity: 0; }
}
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
Additional Identifiers
When additional-identifiers
contains a custom prefix value of khtml
as show below
no-vendor-prefixes:
- 1
-
additional-identifiers:
- khtml
The following would now also be disallowed
.baz {
position: -khtml-sticky;
}
Excluded Identifiers
When excluded-identifiers
contains currently disallowed prefix values such as webkit
and moz
as show below
no-vendor-prefixes:
- 1
-
excluded-identifiers:
- webkit
- moz
The following would now be allowed
@-webkit-keyframes anim {
0% { opacity: 0; }
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
While the following would remain disallowed
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
Ignore Non Standard
ignore-non-standard
is an option that allows you to specify whether only standard properties from our properties list should be affected by this rule or if any prefixed property / element should be affected.
When ignore-non-standard
is set to false
the following are disallowed, when ignore-non-standard
is set to true
the following are allowed:
html {
-webkit-tap-highlight-color: $link-color-hover;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
Don't include leading zeros on numbers Open
border-radius: 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Qualifying elements are not allowed for class selectors Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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-class should be nested within its parent Attribute-selector Open
main [type=button]:hover,
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Selectors must be placed on new lines Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Read upRead up
- Exclude checks
Single Line Per Selector
Rule single-line-per-selector
will enforce whether selectors should be placed on a new line.
Examples
When enabled, the following are allowed:
.foo,
.bar {
content: 'baz';
}
When enabled, the following are disallowed:
.foo, .bar {
content: 'baz';
}
Class should be nested within its parent Class Open
.pagination .active .page-link {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Type-selector should be nested within its parent Type-selector Open
footer 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0 0.5em 1em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
margin-left: 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class '.field_with_errors' should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Read upRead up
- Exclude checks
Class Name Format
Rule class-name-format
will enforce a convention for class names.
Options
-
allow-leading-underscore
:true
/false
(defaults totrue
) -
convention
:'hyphenatedlowercase'
(default),camelcase
,snakecase
,strictbem
,hyphenatedbem
, or a Regular Expression that the class name must match (e.g.^[_A-Z]+$
) -
convention-explanation
: Custom explanation to display to the user if a class doesn't adhere to the convention -
ignore
: Array of names to ignore
Example 1
Settings:
- allow-leading-underscore: true
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&._with-leading-underscore {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 2
Settings:
- allow-leading-underscore: false
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&.another-hyphenated-lowercase {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
._with-leading-underscore {
content: '';
}
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 3
Settings:
- convention: camelcase
When enabled, the following are allowed:
.camelCase {
content: '';
}
.foo {
@extend .anotherCamelCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 4
Settings:
- convention: pascalcase
When enabled, the following are allowed:
.PascalCase {
content: '';
}
.Foo {
@extend .AnotherPascalCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 5
Settings:
- convention: snakecase
When enabled, the following are allowed:
.snake_case {
content: '';
}
.foo {
@extend .another_snake_case;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 6
Settings:
- convention: strictbem
When enabled, the following are allowed:
.block-name__elem-name {
content: '';
}
.owner-name_mod-name_mod-val {
content: '';
}
.block-name__elem-name_mod-bool {
content: '';
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 7
Settings:
- convention: hyphenatedbem
When enabled, the following are allowed:
.site-search {
color: blue;
width: 50px;
height: 100%;
}
.site-search__field {
text-decoration: underline;
}
.site-search--full {
color: green;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 8
Settings:
- convention: ^[_A-Z]+$
- convention-explanation: 'Class must contain only uppercase letters and underscores'
When enabled, the following are allowed:
.SCREAMING_SNAKE_CASE {
content: '';
}
.foo {
@extend .SCREAMING_SNAKE_CASE;
}
When enabled, the following are disallowed:
(Each line with a class will report Class must contain only uppercase letters and underscores
when linted.)
.HYPHENATED-UPPERCASE {
content: '';
}
.snake_case {
content: '';
}
.foo {
@extend .camelCase;
}
Type-selector should be nested within its parent Class Open
.c-sidebar-brand img {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.table-striped th.page {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 1.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
!important not allowed Open
color: $white !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
!important not allowed Open
margin-left: 14em !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Class should be nested within its parent Class Open
.table-striped .actions {
- 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: '';
}
}
Don't include leading zeros on numbers Open
font-size: 0.8em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Vendor prefixes should not be used Open
-webkit-align-self: center;
- Read upRead up
- Exclude checks
No Vendor Prefixes
Rule no-vendor-prefixes
will enforce that vendor prefixes are not allowed to be used.
List of prefixes affected by default: * webkit * moz * ms
Options
-
additional-identifiers
:[array of additional prefixes to check for]
(defaults to empty array[]
) -
excluded-identifiers
:[array of prefixes to exclude checking for]
(defaults to empty array[]
) -
ignore-non-standard
:true
:false
(defaults tofalse
)
Examples
When enabled, the following are disallowed:
@-webkit-keyframes anim {
0% { opacity: 0; }
}
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
Additional Identifiers
When additional-identifiers
contains a custom prefix value of khtml
as show below
no-vendor-prefixes:
- 1
-
additional-identifiers:
- khtml
The following would now also be disallowed
.baz {
position: -khtml-sticky;
}
Excluded Identifiers
When excluded-identifiers
contains currently disallowed prefix values such as webkit
and moz
as show below
no-vendor-prefixes:
- 1
-
excluded-identifiers:
- webkit
- moz
The following would now be allowed
@-webkit-keyframes anim {
0% { opacity: 0; }
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
While the following would remain disallowed
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
Ignore Non Standard
ignore-non-standard
is an option that allows you to specify whether only standard properties from our properties list should be affected by this rule or if any prefixed property / element should be affected.
When ignore-non-standard
is set to false
the following are disallowed, when ignore-non-standard
is set to true
the following are allowed:
html {
-webkit-tap-highlight-color: $link-color-hover;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
Type-selector should be nested within its parent Type-selector Open
main input {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
main .textlong {
- 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-class should be nested within its parent Attribute-selector Open
main [type=submit]:hover,
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Qualifying elements are not allowed for class selectors Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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';
}
Class '.field_with_errors' should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Read upRead up
- Exclude checks
Class Name Format
Rule class-name-format
will enforce a convention for class names.
Options
-
allow-leading-underscore
:true
/false
(defaults totrue
) -
convention
:'hyphenatedlowercase'
(default),camelcase
,snakecase
,strictbem
,hyphenatedbem
, or a Regular Expression that the class name must match (e.g.^[_A-Z]+$
) -
convention-explanation
: Custom explanation to display to the user if a class doesn't adhere to the convention -
ignore
: Array of names to ignore
Example 1
Settings:
- allow-leading-underscore: true
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&._with-leading-underscore {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 2
Settings:
- allow-leading-underscore: false
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&.another-hyphenated-lowercase {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
._with-leading-underscore {
content: '';
}
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 3
Settings:
- convention: camelcase
When enabled, the following are allowed:
.camelCase {
content: '';
}
.foo {
@extend .anotherCamelCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 4
Settings:
- convention: pascalcase
When enabled, the following are allowed:
.PascalCase {
content: '';
}
.Foo {
@extend .AnotherPascalCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 5
Settings:
- convention: snakecase
When enabled, the following are allowed:
.snake_case {
content: '';
}
.foo {
@extend .another_snake_case;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 6
Settings:
- convention: strictbem
When enabled, the following are allowed:
.block-name__elem-name {
content: '';
}
.owner-name_mod-name_mod-val {
content: '';
}
.block-name__elem-name_mod-bool {
content: '';
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 7
Settings:
- convention: hyphenatedbem
When enabled, the following are allowed:
.site-search {
color: blue;
width: 50px;
height: 100%;
}
.site-search__field {
text-decoration: underline;
}
.site-search--full {
color: green;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 8
Settings:
- convention: ^[_A-Z]+$
- convention-explanation: 'Class must contain only uppercase letters and underscores'
When enabled, the following are allowed:
.SCREAMING_SNAKE_CASE {
content: '';
}
.foo {
@extend .SCREAMING_SNAKE_CASE;
}
When enabled, the following are disallowed:
(Each line with a class will report Class must contain only uppercase letters and underscores
when linted.)
.HYPHENATED-UPPERCASE {
content: '';
}
.snake_case {
content: '';
}
.foo {
@extend .camelCase;
}
Pseudo-class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Class should be nested within its parent Class Open
.table-striped .width5pc {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.table-striped td label {
- 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-class should be nested within its parent Type-selector Open
.table-striped .actions a:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Type-selector should be nested within its parent Type-selector Open
main input, select, textarea {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Attribute values should be surrounded by quotes Open
main [type=checkbox] {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Attribute values should be surrounded by quotes Open
main [type=submit],
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Class '.field_with_errors' should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Read upRead up
- Exclude checks
Class Name Format
Rule class-name-format
will enforce a convention for class names.
Options
-
allow-leading-underscore
:true
/false
(defaults totrue
) -
convention
:'hyphenatedlowercase'
(default),camelcase
,snakecase
,strictbem
,hyphenatedbem
, or a Regular Expression that the class name must match (e.g.^[_A-Z]+$
) -
convention-explanation
: Custom explanation to display to the user if a class doesn't adhere to the convention -
ignore
: Array of names to ignore
Example 1
Settings:
- allow-leading-underscore: true
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&._with-leading-underscore {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 2
Settings:
- allow-leading-underscore: false
- convention: hyphenatedlowercase
When enabled, the following are allowed:
.hyphenated-lowercase {
content: '';
&.another-hyphenated-lowercase {
content: '';
}
}
.foo {
@extend .hyphenated-lowercase;
}
When enabled, the following are disallowed:
._with-leading-underscore {
content: '';
}
.HYPHENATED-UPPERCASE {
content: '';
}
.camelCase {
content: '';
@extend .snake_case;
}
Example 3
Settings:
- convention: camelcase
When enabled, the following are allowed:
.camelCase {
content: '';
}
.foo {
@extend .anotherCamelCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 4
Settings:
- convention: pascalcase
When enabled, the following are allowed:
.PascalCase {
content: '';
}
.Foo {
@extend .AnotherPascalCase;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .snake_case;
}
Example 5
Settings:
- convention: snakecase
When enabled, the following are allowed:
.snake_case {
content: '';
}
.foo {
@extend .another_snake_case;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 6
Settings:
- convention: strictbem
When enabled, the following are allowed:
.block-name__elem-name {
content: '';
}
.owner-name_mod-name_mod-val {
content: '';
}
.block-name__elem-name_mod-bool {
content: '';
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 7
Settings:
- convention: hyphenatedbem
When enabled, the following are allowed:
.site-search {
color: blue;
width: 50px;
height: 100%;
}
.site-search__field {
text-decoration: underline;
}
.site-search--full {
color: green;
}
When enabled, the following are disallowed:
.HYPHENATED-UPPERCASE {
content: '';
}
.foo {
@extend .camelCase;
}
Example 8
Settings:
- convention: ^[_A-Z]+$
- convention-explanation: 'Class must contain only uppercase letters and underscores'
When enabled, the following are allowed:
.SCREAMING_SNAKE_CASE {
content: '';
}
.foo {
@extend .SCREAMING_SNAKE_CASE;
}
When enabled, the following are disallowed:
(Each line with a class will report Class must contain only uppercase letters and underscores
when linted.)
.HYPHENATED-UPPERCASE {
content: '';
}
.snake_case {
content: '';
}
.foo {
@extend .camelCase;
}
Type-selector should be nested within its parent Type-selector Open
main fieldset legend {
- 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: '';
}
}
Type-selector should be nested within its parent Type-selector Open
footer a:hover {
- 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-class should be nested within its parent Type-selector Open
footer a:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Don't include leading zeros on numbers Open
padding: 0.4em !important;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Type-selector should be nested within its parent Class Open
.c-sidebar-footer 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .hidden {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.table-striped td {
- 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: '';
}
}
Attribute values should be surrounded by quotes Open
.table-striped td [type=checkbox] {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Don't include leading zeros on numbers Open
font-size: 0.8em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Selectors must be placed on new lines Open
main input, select, textarea {
- Read upRead up
- Exclude checks
Single Line Per Selector
Rule single-line-per-selector
will enforce whether selectors should be placed on a new line.
Examples
When enabled, the following are allowed:
.foo,
.bar {
content: 'baz';
}
When enabled, the following are disallowed:
.foo, .bar {
content: 'baz';
}
Class should be nested within its parent Type-selector Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
padding: 0.2em 0.6em 0.2em 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Pseudo-class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active:hover .c-sidebar-nav-icon {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Pseudo-class should be nested within its parent Type-selector Open
.dropdown-menu a:active {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Qualifying elements are not allowed for class selectors Open
.table-striped th.page {
- 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';
}
Type-selector should be nested within its parent Class Open
.table-striped .actions 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: '';
}
}
Class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active:hover {
- 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: '';
}
}
Don't include leading zeros on numbers Open
margin: 0.5em 1px 0.1em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Attribute values should be surrounded by quotes Open
main [type=file] {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active {
- 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: '';
}
}
!important not allowed Open
fill: $white !important;
- Read upRead up
- Exclude checks
No Important
Rule no-important
will enforce that important declarations are not allowed to be used.
Examples
When enabled, the following are disallowed:
.foo {
content: 'bar' !important;
}
Qualifying elements are not allowed for class selectors Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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';
}
Selectors must be placed on new lines Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Read upRead up
- Exclude checks
Single Line Per Selector
Rule single-line-per-selector
will enforce whether selectors should be placed on a new line.
Examples
When enabled, the following are allowed:
.foo,
.bar {
content: 'baz';
}
When enabled, the following are disallowed:
.foo, .bar {
content: 'baz';
}
Type-selector should be nested within its parent Class Open
.table-striped .actions a:hover {
- 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: '';
}
}
Class should be nested within its parent Class Open
.c-sidebar-nav-link.c-active .c-sidebar-nav-icon {
- 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .actions a:hover {
- 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: '';
}
}
Type-selector should be nested within its parent Type-selector Open
main p {
- 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: '';
}
}
Class should be nested within its parent Class Open
.pager .page-link,
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.2em 0 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Type-selector should be nested within its parent Type-selector Open
main textarea {
- 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: '';
}
}
Vendor prefixes should not be used Open
-webkit-align-items: center;
- Read upRead up
- Exclude checks
No Vendor Prefixes
Rule no-vendor-prefixes
will enforce that vendor prefixes are not allowed to be used.
List of prefixes affected by default: * webkit * moz * ms
Options
-
additional-identifiers
:[array of additional prefixes to check for]
(defaults to empty array[]
) -
excluded-identifiers
:[array of prefixes to exclude checking for]
(defaults to empty array[]
) -
ignore-non-standard
:true
:false
(defaults tofalse
)
Examples
When enabled, the following are disallowed:
@-webkit-keyframes anim {
0% { opacity: 0; }
}
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
Additional Identifiers
When additional-identifiers
contains a custom prefix value of khtml
as show below
no-vendor-prefixes:
- 1
-
additional-identifiers:
- khtml
The following would now also be disallowed
.baz {
position: -khtml-sticky;
}
Excluded Identifiers
When excluded-identifiers
contains currently disallowed prefix values such as webkit
and moz
as show below
no-vendor-prefixes:
- 1
-
excluded-identifiers:
- webkit
- moz
The following would now be allowed
@-webkit-keyframes anim {
0% { opacity: 0; }
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
While the following would remain disallowed
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
Ignore Non Standard
ignore-non-standard
is an option that allows you to specify whether only standard properties from our properties list should be affected by this rule or if any prefixed property / element should be affected.
When ignore-non-standard
is set to false
the following are disallowed, when ignore-non-standard
is set to true
the following are allowed:
html {
-webkit-tap-highlight-color: $link-color-hover;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
Attribute values should be surrounded by quotes Open
main [type=reset]:hover {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Class should be nested within its parent Class Open
.pagination .disabled .page-link {
- 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: '';
}
}
Type-selector should be nested within its parent Type-selector Open
main select {
- 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: '';
}
}
Don't include leading zeros on numbers Open
margin: 0.5em 0 0 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
margin: 0.5em 0 0 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.2em 0 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
border-radius: 0.2em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Class Open
.pagination .page-link,
- 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: '';
}
}
Don't include leading zeros on numbers Open
margin: 0.2em 0.2em 0.2em 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Type-selector Open
table.elements {
- 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .width16pc {
- 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: '';
}
}
Type-selector should be nested within its parent Class Open
.c-sidebar-footer a:hover {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0 0.8em 0 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Class should be nested within its parent Class Open
.table-striped .collapse-toggle {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
.table-striped th.page {
- 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .shorter {
- 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .width20pc {
- 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: '';
}
}
Class should be nested within its parent Class Open
.table-striped .width50pc {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Don't include leading zeros on numbers Open
margin: 0.2em 0.2em 0.2em 0;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Type-selector should be nested within its parent Class Open
.breadcrumbs 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: '';
}
}
Multiline style comments should not be used Open
/* Blazer has its own top bar which ours is appearing on top of */
- Read upRead up
- Exclude checks
No CSS Comments
Rule no-css-comments
will enforce the use of Sass single-line comments and disallow CSS comments. Bang comments (/*! */
, will be printed even in minified mode) are still allowed.
Examples
When enabled the following are allowed:
// This is a good comment
// =========
// This is a good comment
// =========
//////////////////
// This is a good comment
//////////////////
/*! This is a good bang comment */
/*!
* This is a good bang comment
**/
When enabled the following are disallowed:
/* This comment will appear in your compiled css */
/*
* Mulitline comments are bad
*/
Class should be nested within its parent Class Open
.table-striped .actions 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: '';
}
}
Type-selector should be nested within its parent Class Open
.table-striped th {
- 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: '';
}
}
Vendor prefixes should not be used Open
-webkit-justify-content: center;
- Read upRead up
- Exclude checks
No Vendor Prefixes
Rule no-vendor-prefixes
will enforce that vendor prefixes are not allowed to be used.
List of prefixes affected by default: * webkit * moz * ms
Options
-
additional-identifiers
:[array of additional prefixes to check for]
(defaults to empty array[]
) -
excluded-identifiers
:[array of prefixes to exclude checking for]
(defaults to empty array[]
) -
ignore-non-standard
:true
:false
(defaults tofalse
)
Examples
When enabled, the following are disallowed:
@-webkit-keyframes anim {
0% { opacity: 0; }
}
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
Additional Identifiers
When additional-identifiers
contains a custom prefix value of khtml
as show below
no-vendor-prefixes:
- 1
-
additional-identifiers:
- khtml
The following would now also be disallowed
.baz {
position: -khtml-sticky;
}
Excluded Identifiers
When excluded-identifiers
contains currently disallowed prefix values such as webkit
and moz
as show below
no-vendor-prefixes:
- 1
-
excluded-identifiers:
- webkit
- moz
The following would now be allowed
@-webkit-keyframes anim {
0% { opacity: 0; }
}
::-moz-placeholder {
content: '';
}
.foo {
-webkit-transition: none;
}
.bar {
position: -moz-sticky;
}
While the following would remain disallowed
.ms-block {
-ms-hyphenate-limit-lines: no-limit;
}
Ignore Non Standard
ignore-non-standard
is an option that allows you to specify whether only standard properties from our properties list should be affected by this rule or if any prefixed property / element should be affected.
When ignore-non-standard
is set to false
the following are disallowed, when ignore-non-standard
is set to true
the following are allowed:
html {
-webkit-tap-highlight-color: $link-color-hover;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
Class should be nested within its parent Class Open
.table-striped .width25pc {
- 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: '';
}
}
Selectors must be placed on new lines Open
main input, select, textarea {
- Read upRead up
- Exclude checks
Single Line Per Selector
Rule single-line-per-selector
will enforce whether selectors should be placed on a new line.
Examples
When enabled, the following are allowed:
.foo,
.bar {
content: 'baz';
}
When enabled, the following are disallowed:
.foo, .bar {
content: 'baz';
}
Class should be nested within its parent Type-selector Open
main .top-margin {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- 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: '';
}
}
Class should be nested within its parent Type-selector Open
main .textnumber {
- 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: '';
}
}
Don't include leading zeros on numbers Open
padding: 0.3em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Attribute values should be surrounded by quotes Open
main [type=button],
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Attribute values should be surrounded by quotes Open
main [type=text] {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Attribute values should be surrounded by quotes Open
main [type=reset] {
- Read upRead up
- Exclude checks
Attribute Quotes
Rule attribute-quotes
will enforce the use of quotes in attribute values.
Options
-
include
:true
/false
(defaults totrue
)
Examples
include
When include: true
, the following are allowed. When include: false
, the following are disallowed:
span[lang="pt"] {
color: green;
}
span[lang~="en-us"] {
color: blue;
}
span[class^="main"] {
background-color: yellow;
}
a[href*="example"] {
background-color: #CCCCCC;
}
input[type="email" i] {
border-color: blue;
}
When include: false
, the following are allowed. When include: true
, the following are disallowed:
span[lang=pt] {
color: green;
}
span[lang~=en-us] {
color: blue;
}
span[class^=main] {
background-color: yellow;
}
a[href*=example] {
background-color: #CCCCCC;
}
input[type=email i] {
border-color: blue;
}
Don't include leading zeros on numbers Open
margin: 0 0 0 0.5em;
- Read upRead up
- Exclude checks
Leading Zero
Rule leading-zero
will enforce whether or not decimal numbers should include a leading zero.
Options
-
include
:true
/false
(defaults tofalse
)
Examples
When include: false
, the following are allowed. When include: true
, the following are disallowed:
.foo {
font-size: .5em;
}
When include: true
, the following are allowed. When include: false
, the following are disallowed:
.foo {
font-size: 0.5em;
}
Pseudo-class should be nested within its parent Attribute-selector Open
main [type=reset]:hover {
- Read upRead up
- Exclude checks
Force Pseudo Nesting
Rule force-pseudo-nesting
will enforce the nesting of pseudo elements/classes.
Examples
When enabled, the following are disallowed: ```scss p:nth-of-type(2) { margin: 0; }
.parent { .child { p::first-line { color: #ff0000; } } }
.parent { .child { .sub p::first-line { color: #ff0000; } } } ```
When enabled, the following are allowed:
p {
&:nth-of-type(2) {
margin: 0;
}
}
.parent {
.child {
p {
&::first-line {
color: #ff0000;
}
}
}
}
.parent {
.child {
.sub p {
&::first-line {
color: #ff0000;
}
}
}
}
Each selector in a comma sequence should be on its own single line Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Properties should be ordered -webkit-align-items, align-items, display, -webkit-justify-content, justify-content Open
-webkit-justify-content: center;
- Exclude checks
Avoid vendor prefixes. Open
display: -webkit-flex;
- Exclude checks
Avoid vendor prefixes. Open
-webkit-align-items: center;
- Exclude checks
Avoid qualifying class selectors with an element. Open
.table-striped th.page {
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
main input, select, textarea {
- Exclude checks
Use //
comments everywhere Open
/* Blazer has its own top bar which ours is appearing on top of */
- Exclude checks
Avoid qualifying class selectors with an element. Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Avoid vendor prefixes. Open
-webkit-align-self: center;
- Exclude checks
Selector field_with_errors
should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Avoid qualifying class selectors with an element. Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Avoid vendor prefixes. Open
-webkit-justify-content: center;
- Exclude checks
Avoid qualifying class selectors with an element. Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Avoid qualifying class selectors with an element. Open
table.elements {
- Exclude checks
Selector field_with_errors
should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
main input, select, textarea {
- Exclude checks
Selector field_with_errors
should be written in lowercase with hyphens Open
input.field_with_errors, select.field_with_errors, textarea.field_with_errors {
- Exclude checks