Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 1.29 KB

File metadata and controls

84 lines (65 loc) · 1.29 KB

no-outline-none

Disallow outline clearing.

Why? Because

Sources:

Options

true

The following pattern is considered a violation:

.foo:focus {
  outline: 0;
}
.bar:focus {
  outline: none;
}
.baz:focus {
  outline: none;
  border: transparent;
}
.quux {
  .quuux:focus {
    outline: 0;
  }
}

The following patterns are not considered violations:

.foo {
  outline: 0;
}
$primary-color: #333;
.bar:focus {
  outline: 1px solid $primary-color;
}
.baz:focus {
  outline: 1px solid #333;
}
.quux:focus {
  outline: 0;
  border: 1px solid #000;
}

Note

Similar rule is in Stylelint, but it triggers another error message and does not check for :focus selector and border property.

{
  "declaration-property-value-blacklist": {
    "outline": ["none", "0"]
  }
}