Showing 657 of 658 total issues
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: '';
}
}
Type-selector should be nested within its parent Class Open
.shinycms-admin-toolbar-links 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: '';
}
}
Hex values should use the shorthand format - 3 characters where possible Open
background: #ddffdd;
- Read upRead up
- Exclude checks
Hex Length
Rule hex-length
will enforce the length of hexadecimal values
Options
-
style
:short
/long
(defaults toshort
)
Examples
When style: short
, the following are allowed. When style: long
, the following are disallowed:
$foo-color: #456;
.bar {
background: linear-gradient(top, #3ff, #ddd);
}
.baz {
color: #fff;
}
When style: long
, the following are allowed. When style: short
, the following are disallowed:
$foo-color: #445566;
.bar {
background: linear-gradient(top, #33ffff, #dddddd);
}
.baz {
color: #ffffff;
}
In both cases the following will be allowed as the values cannot be shortened:
$quz-color: #abcdef;
.qux {
color: #123456;
}
Type-selector should be nested within its parent Class Open
.top-nav ul {
- 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
background-image: -webkit-linear-gradient(top,$button-bg-hover, $dark-red);
- 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;
}