← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

CSS Logical Properties

Frontend CSS4 Intermediate
debt(d3/e3/b3/t5)
d3 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'default linter catches the common case' (d3). Stylelint with appropriate plugins can flag physical properties like margin-left when logical alternatives should be used, and rtlcss can detect RTL override patterns. These are standard tools in frontend workflows that can catch the common case of using physical properties where logical ones would be better.

e3 Effort Remediation debt — work required to fix once spotted

Closest to 'simple parameterised fix' (e3). The quick_fix describes replacing margin-left/right with margin-inline-start/end — a straightforward find-and-replace pattern across CSS files. However, it's slightly more than a one-liner since you need to audit the entire stylesheet and may touch multiple files, but it's still a mechanical transformation within the CSS layer only.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3). Logical properties apply to web contexts only and are CSS-scoped decisions. Once adopted, they reduce maintenance burden (no RTL stylesheet), but the choice doesn't shape the entire system architecture. It's a localised productivity improvement that affects the CSS layer without rippling into JavaScript or backend code.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap' (t5). The misconception explicitly states developers think 'RTL support requires a separate RTL stylesheet' when logical properties eliminate this need. This is a documented gotcha most frontend devs eventually learn. Additional traps include mixing physical and logical properties causing conflicts, and not setting dir=rtl on the html element — both require learning but aren't catastrophically unintuitive once explained.

About DEBT scoring →

Also Known As

logical properties inline start block start RTL CSS LTR

TL;DR

CSS properties that map to physical directions based on writing mode — margin-inline instead of margin-left/right, padding-block instead of padding-top/bottom — enabling RTL support automatically.

Explanation

CSS logical properties replace directional properties with flow-relative equivalents: inline (horizontal in LTR, vertical in TTB) and block (vertical in LTR, horizontal in TTB). margin-inline-start replaces margin-left (automatically becomes margin-right in RTL). padding-block replaces padding-top + padding-bottom. border-inline-end replaces border-right. inset-inline-start replaces left. Use logical properties from the start of a project — retrofitting physical properties for RTL languages requires overriding every physical property in RTL stylesheets.

Common Misconception

RTL support requires a separate RTL stylesheet — using logical properties eliminates the need for a separate RTL override stylesheet; the browser applies the correct physical direction based on the dir attribute.

Why It Matters

A site using margin-left: 16px needs margin-right: 16px in its RTL stylesheet — the same site using margin-inline-start: 16px handles both LTR and RTL automatically with one rule.

Common Mistakes

  • Mixing physical and logical properties — margin-left alongside margin-inline-start causes conflicts.
  • Using logical properties for decorative directional elements — a left-pointing arrow should still be physical.
  • Not setting dir=rtl on the html element for RTL languages — logical properties require a direction context.
  • Browser support gaps — inset-* properties have slightly less support than margin-*/padding-*.

Code Examples

✗ Vulnerable
/* Physical properties — requires RTL override:
.nav-item { margin-left: 16px; border-right: 1px solid; padding-left: 8px; }
/* RTL override needed: */
[dir=rtl] .nav-item { margin-left: 0; margin-right: 16px;
    border-right: none; border-left: 1px solid; padding-left: 0; padding-right: 8px; }
✓ Fixed
/* Logical properties — RTL works automatically:
.nav-item {
    margin-inline-start: 16px;  /* margin-left in LTR, margin-right in RTL */
    border-inline-end: 1px solid; /* border-right in LTR, border-left in RTL */
    padding-inline-start: 8px;
}
/* No RTL override needed — browser handles it based on dir attribute */

Added 16 Mar 2026
Edited 22 Mar 2026
Views 54
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 3 pings S 1 ping S 2 pings M 0 pings T 3 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 1 ping S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 10 Perplexity 7 Scrapy 6 Ahrefs 4 Google 3 ChatGPT 3 Unknown AI 2 Claude 2 Bing 2 PetalBot 2 SEMrush 1 Meta AI 1 Majestic 1
crawler 40 crawler_json 4
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Medium
⚡ Quick Fix
Replace margin-left/right with margin-inline-start/end and padding-top/bottom with padding-block-start/end — these flip automatically for RTL languages without extra CSS
📦 Applies To
css CSS4 web
🔗 Prerequisites
🔍 Detection Hints
Separate RTL stylesheet duplicating layout rules; margin-left/right used for directional spacing needing RTL override
Auto-detectable: ✓ Yes stylelint rtlcss
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: Medium ✓ Auto-fixable Fix: Low Context: File


✓ schema.org compliant