Physical/logical properties, keywords, and functions

Table of Contents

This list is based on the MDN properties reference, and the index of CSS properties.

I have attempted to capture all the places where axis or side is implied by the order of values – which includes (but is not limited to) shorthand properties. For example, background-position is a shorthand for background-position-x and background-position-y – but object-position uses the same syntax without having individual longhand sub-properties.

This is not meant to be a prescriptive list of which properties should provide logical alternatives, but a descriptive list of what properties could be toggled from one syntax to another.

Apart from properties, all <basic-shape> functions, transform functions, and gradient functions currently use physical syntax – and there have been various requests for logical alternatives. It’s not clear to me on first-glance if a logical/physical toggle could (or should) change how those functions are parsed.

As a side-note, I also captured where we have physical keywords without logical alternatives, although that’s clearly tangential to the syntax-toggle issue, since they are explicit to an axis or side. Still, they seem relevant to a larger question of providing logical alternatives wherever it is useful.

I think the next step is to sort these into groups by shared syntax, and describe how a toggle (either local or global) would apply to each.

You can support this effort or read more about it.

Multi-value properties

These accept multiple dimensions in a single syntax, but don’t have associated sub-properties for the dimensions involved. Ideally, a global toggle would apply here.

No change needed…

Shorthand properties

These shorthands accept dimensions, which can be set individually using sub-properties. Some of them have logical as well as physical long-hand properties available, while some are missing either the physical or logical alternative.

No change needed…

Keywords

Since keywords clearly establish physical/logical directions, they would not be impacted by a global ‘switch’ – but it’s still useful to know where logical functionality might be missing.

Properties including background-position, mask-position, object-position, offset-position, fill-position, and stroke-position all use the <position> syntax with optional offset keywords. That allows for positioning relative to either a physical or logical edge without any toggle on the property parsing itself.

No change needed…

Functions

SVG

Most SVG-related properties such as cx and cy only provide physical syntax. However, the text-anchor property only has start and end values, with no physical variant. We could consider adding physical keywords for text-anchor, but I don’t see any need for a syntax toggle.

The fill & stroke properties have *-image, *-position, *-size, and *-repeat sub-properties specified – but not currently implemented. Any changes to similar background/border productions, should apply here. I think this is the only place a syntax toggle would impact SVGs.