Shared coding conventions make it possible for a team to collaborate efficiently. This rule allows to check compliance with formatting standards.
.mybox
{ /* Noncompliant: the opening curly brace should be moved to the previous line */
color: red;
}
.mybox { color : red; /* Noncompliant: the code following the opening curly brace should be moved to the next line */
}
.mybox {
color: red;
} .mybox { /* Noncompliant: the code following the closing curly brace should be moved to the next line */
color: blue;
}
.mybox {
color : red; } /* Noncompliant: the closing curly brace should be moved to the next line */
.mybox {
color: red;
}
.mybox {
color: blue;
}
.mybox {
color: /* Noncompliant: value should be on the same line as property and colon */
red;
}
.mybox {
--abc: /* Noncompliant: value should be on the same line as variable and colon */
red;
}
.mybox {
color : red; /* Noncompliant: there shouldn't be any whitespace between the property and the colon */
}
.mybox {
--abc : red; /* Noncompliant: there shouldn't be any whitespace between the variable and the colon */
}
.mybox {
color: red; /* Noncompliant: there should be one single whitespace between the colon and the value */
}
.mybox {
color:red; /* Noncompliant: there should be one single whitespace between the colon and the value */
}
.mybox {
color: red;
}
.mybox {
--abc: red;
}
There should not be any whitespaces between ! and important.
.mybox {
color: red ! important; /* Noncompliant */
}
.mybox {
color: red !important;
}