Jens Oliver Meiert

CSS: When to Use Logical Properties

Post from November 22, 2019 (↻ August 15, 2020), filed under .

Brief thoughts on a more complex matter. Logical properties are great and long overdue. They are great because they solve an ugly problem of international, multi-directional web development in that directionality does not need to affect your writing and managing of CSS anymore.

Example: Write

p {
  margin-inline-start: 1rem;

instead of something (intentionally verbose) like

p {
  margin-left: 1rem;
  margin-right: 0;

[dir='rtl'] p {
  margin-left: 0;
  margin-right: 1rem;

But when should you use logical properties?

First, when support is sufficient for your project’s needs.

Then, when that’s the case, there are really two answers:

The reasonable answer: If you actually work with sites or apps with two directionalities. Logical properties may turn into a best practice, but not using logical properties may actually never turn into a bad practice for projects of only one directionality.

The easy answer: If you want to. It’s completely up to you.

All other answers are nonsense, especially when they contain being judged or guilt-tripped by other developers. Logical properties have their particular use in bidirectional environments.

Was this interesting? Feel free to tweet this, or to invite me for a coffee! Thank you!

About Me

Jens Oliver Meiert, on April 29, 2020.

I’m Jens Oliver Meiert, and I’m a web developer (engineering manager) and author. I love trying things, sometimes including philosophy, art, and adventure. Here on I share some of my views and experiences.

If you have questions or suggestions about what I write, please leave a comment (if available) or a message.

Read More

Have a look at the most popular posts, possibly including:

Cover: CSS Optimization Basics.

Perhaps my most relevant book: CSS Optimization Basics (2018). Writing CSS is a craft. As craftspeople we strive to write high quality CSS. In CSS Optimization Basics I lay out some of the most important aspects of such CSS. Available at Amazon, Google Play Books, and Leanpub.

Stay up-to-date? Follow me by feed or on Twitter.

Looking for a way to comment? Comments have been disabled, unfortunately.

Found a mistake? Email me,

You are here: HomeArchive2019 → CSS: When to Use Logical Properties

Last update: August 15, 2020

“Work is love made visible.”