Skip to content

[css-logical] Add some logical version for box-shadow and text-shadow #6338

@mrego

Description

@mrego

Spec: https://drafts.csswg.org/css-logical/

It'd be nice to add the possibility to set the shadow offsets as inline and block so if we have a vertical writing mode it still looks similar.

Example:

  text-shadow: 10px 5px magenta;
  box-shadow: 20px 10px cyan;
  background: yellow;

On an element with horizontal writing mode the text shadow will be 10px on the right and 5px down, and the box shadow 20px on the right and 10px down.
And the same will happen on a vertical element.

Output of text-shadow and box-shadow from the previous example (text shadow will be 10px on the right and 5px down, and the box shadow 20px on the right and 10px down and the same on the vertical element)

If we could set those values in a logical form setting inline and block offset we could get the same effect in both horizontal and vertical writing modes. On the vertical element the text shadow will be 10px down and 5px to the left, and the box shadow 20px down and 10px left.

Proposed output if we have logical properties (the horizontal case is the same than before but the vertical one changes, now text shadow will be 10px down and 5px to the left, and the box shadow 20px down and 10px left

Note that there's a proposal to make box-shadow and text-shadow a shorthand, so this would be part of the box|text-shadow-offset.

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