CSS highlight pseudo-elements representing text that the UA has flagged as misspelled or grammatically incorrect, and text-decoration-line property values representing the UA's default decorations for spelling mistakes and grammar mistakes. This features includes the implementation of two pseudo-elements: ::spelling-error and ::grammar-error; and two new values for the text-decoration-line property: spelling-error and grammar-error.

Motivation

Authors should be able to customise the appearance of spelling/grammar mistakes. For example, the UA’s default colour for a mistake might be of inadequate contrast with some background colours. The pseudo-elements would enable this, while the text-decoration-line values would allow the UA stylesheet to express the default decoration, as well as allow authors to decorate other text as if it was a spelling/grammar mistake (e.g. for a custom spell checker).

Demo

Specification

Specification link


Specification being incubated in a Community Group

Status in Chromium

Blink>CSS


No active development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Last updated on 2021-01-07