Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 895 Bytes

File metadata and controls

59 lines (43 loc) · 895 Bytes

border-widths

Specify scales for border widths.

a {
  border-width: 0.1rem;
}
/**               ↑
 *                This width */

This rule can automatically fix all of the problems reported.

This rule checks <length> values.

This rule can be paired with the declaration-property-unit-allowed-list rule in stylelint, using the RegEx:

/^border$|^border.*(width$|top$|right$|bottom$|left$/

Options

array of objects as {scale: [], units: []}

Given:

[{ "scale": [1, 2], "units": ["px"] }]

The following patterns are considered violations:

a {
  border-width: 3px;
}
a {
  border: 3px solid red;
}

The following patterns are not considered violations:

a {
  border-width: 1px;
}
a {
  border: 2px solid red;
}