← All notes

CSS logical properties: style against writing direction

Answer: Logical properties can change if the text direction or writing mode changes. Use logical properties such as inline-size, block-size, and margin-inline for layout dimensions and spacing.

Flow-relative sizing and spacing

A common pattern is a text label with an icon that sits to the left, but that only works when the text direction is left to right.

If the text direction changes to right-to-left, that physical layout can sit the icon up against the text.

Logical properties can change if the text direction or writing mode changes.

Flow-relative equivalents include max-inline-size and max-block-size, and also min-inline-size and min-block-size.

You can use padding-block-start, margin-inline-start, and inset-block-start instead of physical sides.

When to prefer them in layout

Reach for intrinsic sizing and logical properties before hardcoded dimensions or complicated media queries.

Use logical properties such as inline-size, block-size, margin-inline, padding-block, and inset-inline-start for layout dimensions and spacing.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Logical properties; Chrome Developers, CSS: Modern Architecture. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, Logical properties; Chrome Developers, CSS: Modern Architecture. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC.

Cite this

Permanent ID: iil:note:k0f63vn5

iinventedlight. 2026. "CSS logical properties: style against writing direction." iinventedlight Library, iil:note:k0f63vn5, version of 2026-11-23. https://iinventedlight.com/library/notes/css-logical-properties/. License: CC-BY-4.0.

@misc{iil_note_k0f63vn5,
  author = {{iinventedlight}},
  title = {{CSS logical properties: style against writing direction}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/css-logical-properties/},
  note = {Permanent ID iil:note:k0f63vn5. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-logical-properties.md.