Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 1.26 KB

File metadata and controls

76 lines (56 loc) · 1.26 KB

no-at-important

This rule forbid the use of !important. !important make css maintenance hard, you should use it with care.

options

true

The following pattern are considered violations:

a {
  color: white !important;
}

.foo {
  color: white !important;
}

ignoreLayers: ["string"]

The ITCSS archi is based on layers, it can be usefull to use !important in some of them like the utilities one.

This option disable the rule in the layers targeted by the option's content.

For example, given ignoreLayers: ["utilities"]

The following patterns are not considered violations:

// file `styles/utilities/_utilities.util.css`
a {
  color: white !important;
}

.foo {
  color: white !important;
}
// file `styles/utilities/util.css`
a {
  color: white !important;
}

.foo {
  color: white !important;
}

The following patterns are considered violations:

// file `styles/layer/main.css`
a {
  color: white !important;
}

.foo {
  color: white !important;
}
// file `styles/layer/_layer.main.css`
a {
  color: white !important;
}

.foo {
  color: white !important;
}