Skip to content
Painter
CSS

Logical properties, and the day the site went RTL

Writing margin-inline-start instead of margin-left costs nothing today and saves a month the first time somebody asks for Arabic.

Physical properties assume a direction. Logical ones describe the relationship: start and end rather than left and right, block and inline rather than vertical and horizontal.

The day a right-to-left locale is added, every logical property keeps working and every physical one has to be found and flipped by hand.

/* Flips automatically under dir="rtl" */
.card { padding-inline: 1.25rem; margin-block-end: 1rem; border-inline-start: 3px solid; }

There is no performance argument here and no downside. It is simply the more accurate way to say what you meant.

Leave a comment

Real questions get real answers. The editorial team reads every thread.