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$/
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;
}