Skip to content

[css-text-decor] [css-pseudo] default ‘text-decoration-color’ of ‘spelling-error’ and ‘grammar-error’ #7522

@delan

Description

@delan

https://drafts.csswg.org/css-text-decor-4/#text-decoration-line-property

Since spelling-error and grammar-error decorations are entirely UA-defined, the UA may disregard the other sub-properties of text-decoration, as well any other properties typically affecting the appearance of line decorations (such as text-underline-position, color, stroke, or fill) when rendering these decorations. However, to the extent that honoring any of these properties would be meaningful and practical given the UA’s chosen rendering, the UA should apply them as modifications to its default styling.

This suggests the UA is allowed (but not required) to heed ‘text-decoration-color’ when ‘text-decoration-line’ is set to ‘spelling-error’ or ‘grammar-error’. But if the UA heeds ‘text-decoration-color’, how would it represent the default spelling/grammar decoration color (usually red or green) in UA rules for spelling/grammar pseudos? The initial value of ‘currentColor’ won’t work.

:root::spelling-error { text-decoration: <color> spelling-error; }
:root::grammar-error { text-decoration: <color> grammar-error; }

Do we need to define system colors for these, or can the UA make up its own internal color values? What do authors do if they want to reliably add decorations that look like native spelling/grammar decorations, including the decoration color?

(@fantasai, @frivoal, @mrego)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions