Skip to content

[css-text-decor] Default color of text-shadow #942

Closed
@jfkthame

Description

@jfkthame

https://drafts.csswg.org/css-text-decor-3/#text-shadow-property says that:

If the color of the shadow is not specified, the shadow has the resulting color of the ink that it shadows.

This seems to imply, for instance, that a colored emoji glyph would by default (i.e. no explicit shadow color is specified) cast a multi-colored shadow, as its ink is multi-colored. But ISTM that a "shadow" is inherently monochrome, regardless of the color(s) of the thing being shadowed.

Perhaps this text was written with text decorations in mind, given that text-decoration-color can give different colors to underline, overline, etc.; so the "ink" of a decoration may have a different color than the "ink" of the associated text, and the intent may have been to allow different-colored decorations to cast corresponding different-colored shadows.

But this still seems wrong to me. In the case of text with a colored underline (perhaps even multiple, differently-colored decoration lines), I think the natural interpretation of text-shadow is that it causes the complete (decorated) text rendering to cast a single, monochromatic shadow, and not that it causes the (bare) text to cast a shadow that then has various-colored decorations applied to it.

Also, compare box-shadow, which says:

If the color is absent, the used color is taken from the ‘color’ property.

So a multi-colored <img>, for example, does not magically cast a multi-colored shadow. Neither should multi-colored decorated text, IMO, cast a multi-colored shadow.

Therefore, I suggest the text-shadow spec should be changed to be like box-shadow in this respect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions