avoid-inline-spacing

Inline style must not force text spacing below the WCAG metric

automaticWCAG 1.4.12 (AA)confidence: highseverity: moderateperceivable

Checks that where inline style forces line-height, letter-spacing or word-spacing with !important, the value already meets WCAG 1.4.12, so the user has nothing left to override.

Applies to. Applies to a rendered element with visible text of its own whose style attribute declares line-height, letter-spacing or word-spacing as `!important` with a real value. A CSS-wide keyword (inherit, initial, unset, revert) specifies no spacing of its own and is out of scope.

Expectation. Each such declaration already meets WCAG 1.4.12's own metric for that property, as a multiple of the font size: line-height at least 1.5, letter-spacing at least 0.12, word-spacing at least 0.16. A forced value that already satisfies the criterion leaves the user nothing to override.

Examples

pass
<p style="letter-spacing:2px !important">Spaced text</p>

The forced letter-spacing is above the WCAG 1.4.12 minimum metric.

fail
<p style="line-height:1.2 !important">Spaced text</p>

`!important` forces line-height below the 1.5 minimum, and the page's own styles can't override it.

View source