Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 2.39 KB

no-whitespace-within-word.md

File metadata and controls

57 lines (33 loc) · 2.39 KB

no-whitespace-within-word

✅ The extends: 'recommended' property in a configuration file enables this rule.

In practice, the predominant issue raised by inline whitespace styling is that the resultant text 'formatting' is entirely visual in nature; the ability to discern the correct manner in which to read the text, and therefore, to correctly comprehend its meaning, is restricted to sighted users.

Using in-line whitespace word formatting produces results that are explicitly mentioned in WCAG's list of common sources of web accessibility failures. Specifically, this common whitespace-within-word-induced web accessibility issue fails to successfully achieve WCAG Success Criterion 1.3.2: Meaningful Sequence.

The no-whitespace-within-word rule operates on the assumption that artificially-spaced English words in rendered text content contain, at a minimum, two word characters fencepost-delimited by three whitespace characters (space-char-space-char-space) so it should be avoided.

Examples

This rule forbids the following:

W e l c o m e

W e l c o m e

Wel c o me

Wel c o me

<div>W e l c o m e</div>

<div>Wel c o me</div>

This rule allows the following:

Welcome

Yes&nbsp;I&nbsp;am

It is possible to get some examples of in-word emph a sis past this rule.

However, I do not want a rule that flags annoying false positives for correctly-used single-character words.

<div>Welcome</div>

<div>Yes&nbsp;I am.</div>

This rule uses the heuristic of letter, whitespace character, letter, whitespace character, letter which makes it a good candidate for most use cases, but not ideal for some languages (such as Japanese).

Migration

Use CSS to add letter-spacing to a word.

References