Showing 657 of 658 total issues
Vendor prefixes should not be used Open
background-image: -webkit-linear-gradient(top,$button-bg-hover, $dark-red);
- 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;
}
Vendor prefixes should not be used Open
background-image: -ms-linear-gradient(top,$button-bg-hover, $dark-red);
- 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;
}
Duplicate properties are not allowed within a block Open
background-image: -ms-linear-gradient(top, $button-bg-active, $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;
}
Vendor prefixes should not be used Open
background-image: -ms-linear-gradient(top, $button-bg-active, $red);
- 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
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75), inset 0 2px 0 0 rgba(255, 192, 192, 0.5), inset 0 0 0 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
- 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;
}
Color functions such as 'rgba' should only be used in variable declarations Open
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75), inset 0 2px 0 0 rgba(255, 192, 192, 0.5), inset 0 0 0 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
- Read upRead up
- Exclude checks
No Color Literals
Rule no-color-literals
will disallow the use of color literals and basic color functions in any declarations other than variables or maps/lists.
The list of affected color functions are as follows:
* rgb
* rgba
* hsl
* hsla
Other color functions, such as adjust-color
and mix
, may be used, but the original color must be passed in as a variable.
Options
-
allow-map-identifiers
:true
/false
(defaults totrue
) -
allow-rgba
:true
/false
(defaults tofalse
) -
allow-variable-identifiers
:true
/false
(defaults totrue
)
Examples
When enabled and default options are used the following are disallowed.
.literal {
color: mediumslateblue;
}
.linear-gradient-func {
background: linear-gradient(top, #fff, white);
}
.box-shadow {
box-shadow: 1px 1px black, 1px 1px black;
}
.background {
background: 1px solid white;
}
.hex {
color: #fff;
}
// rgb function passed directly as function argument
.adj {
color: adjust-color(rgb(255, 0, 0), $blue: 5);
}
// hsl function passed directly as function argument
.scale {
color: scale-color(hsl(120, 70%, 80%), $lightness: 50%);
}
// hsl function passed directly as function argument
.change {
color: change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: .8);
}
// color literal passed directly as function argument
.function {
color: test(#fff);
}
// color functions used directly as property values
.rgb {
color: rgb(255, 255, 255);
}
.rgba {
color: rgba(255, 255, 255, .3);
}
.hsl {
color: hsl(40, 50%, 50%);
}
.hsla {
color: hsla(40, 50%, 50%, .3);
}
When enabled and default options are used the following are allowed.
$literal: mediumslateblue;
$hexVar: #fff;
$rgb: rgb(255, 255, 255);
$rgba: rgba(255, 255, 255, .3);
$hsl: hsl(40, 50%, 50%);
$hsla: hsla(40, 50%, 50%, .3);
// using color literals as property names
$colors: (
red: #fff,
blue : (
orange: #fff
)
);
// using color literals as variable identifiers
$black: #000;
.literal {
color: $literal;
}
.linear-gradient-func {
background: linear-gradient(top, $hexVar, $literal);
}
.background {
background: 1px solid $literal;
}
.hex {
color: $hexVar;
}
.adj {
color: adjust-color($off-red, $blue: 5);
}
.scale {
color: scale-color($off-blue, $lightness: 50%);
}
.change {
color: change-color($orange-extra, $lightness: 40%, $alpha: .8);
}
.function {
color: test($hexVar);
}
.rgb {
color: $rgb;
}
.rgba {
color: $rgba;
}
.hsl {
color: $hsl;
}
.hsla {
color: $hsla;
}
[allow-rgba: true]
When enabled and allow-rgba
is set to true
, the following will be allowed:
// rgba in variables is still fine
$rgba: rgba(255, 0, 0, .5);
$red: rgb(255, 255, 255,);
// rgba can be used directly to alter a variables opacity
.color {
color: rgba($red, .3);
}
In addition, when enabled and allow-rgba
is set to true
, the following will be disallowed:
.color {
// you must use variables and not literals
color: rgba(0, 0, 0, .3);
color: rgba(black, .3);
}
[allow-variable-identifiers: false]
When enabled and allow-variable-identifiers
is set to false
, the following will be disallowed
// variable uses a color literal as an identifier
$black: #000
// variable using a color literal as an identifier is passed to a function
.test {
color: adjust-color($off-red, $blue: 5)
}
When enabled and allow-variable-identifiers
is set to false
, the following will be allowed
// variable not directly using a color literal as an identifier
$primary-black: #000
[allow-map-identifiers: false]
When enabled and allow-map-identifiers
is set to false
, the following will be disallowed
// map identifiers red, blue and orange share their name with a
// color literal and therefore shouldn't be used
$colors: (
red: #f00,
blue: (
orange: $orange
)
)
When enabled and allow-map-identifiers
is set to false
, the following will be allowed
$colors: (
primary-red: #f00,
map-blue: (
off-orange: $orange
)
)
Type-selector should be nested within its parent Type-selector Open
nav .sm li li 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.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: '';
}
}
Multiline style comments should not be used Open
/* ShinyCMS ~ https://shinycms.org
- 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
*/
Multiline style comments should not be used Open
/* ===== ( styles for tag clouds ) ===== */
- 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
*/
Hex notation should all be lower case Open
$light-blue: #89C4F4;
- Read upRead up
- Exclude checks
Hex Notation
Rule hex-notation
will enforce the case of hexadecimal values
Options
-
style
:lowercase
/uppercase
(defaults tolowercase
)
Examples
When style: lowercase
, the following are allowed. When style: uppercase
, the following are disallowed:
$foo-color: #fff;
.bar {
background: linear-gradient(top, #cc2, #44d);
}
.baz {
color: #12a;
}
When style: uppercase
, the following are allowed. When style: lowercase
, the following are disallowed:
$foo-color: #FFF;
.bar {
background: linear-gradient(top, #CC2, #44D);
}
.baz {
color: #12A;
}
In both cases the following will be allowed as the values contain only numbers:
.qux {
color: #123;
}