Block-Direction Properties
Generate single rule without direction selectors - optimized for performance
This document provides a comprehensive reference of all CSS logical properties supported by postcss-logical-polyfill, including how they are transformed and categorized.
The plugin intelligently categorizes logical properties into three main types:
Block-Direction Properties
Generate single rule without direction selectors - optimized for performance
Inline-Direction Properties
Generate separate LTR and RTL rules with direction selectors
Mixed-Direction Properties
Affect both dimensions, generate LTR/RTL rules as needed
These properties only affect the block dimension (vertical in most writing modes) and generate a single rule without direction selectors, optimizing CSS output size.
margin-block → margin-top + margin-bottommargin-block-start → margin-topmargin-block-end → margin-bottompadding-block → padding-top + padding-bottompadding-block-start → padding-toppadding-block-end → padding-bottomborder-block → border-top + border-bottomborder-block-start → border-topborder-block-end → border-bottomborder-block-width → border-top-width + border-bottom-widthborder-block-style → border-top-style + border-bottom-styleborder-block-color → border-top-color + border-bottom-colorborder-block-start-width → border-top-widthborder-block-start-style → border-top-styleborder-block-start-color → border-top-colorborder-block-end-width → border-bottom-widthborder-block-end-style → border-bottom-styleborder-block-end-color → border-bottom-colorinset-block → top + bottominset-block-start → topinset-block-end → bottomblock-size → heightmin-block-size → min-heightmax-block-size → max-heightscroll-margin-block → scroll-margin-top + scroll-margin-bottomscroll-margin-block-start → scroll-margin-topscroll-margin-block-end → scroll-margin-bottomscroll-padding-block → scroll-padding-top + scroll-padding-bottomscroll-padding-block-start → scroll-padding-topscroll-padding-block-end → scroll-padding-bottomoverflow-block → overflow-yoverscroll-behavior-block → overscroll-behavior-ycontain-intrinsic-block-size → contain-intrinsic-heightThese properties affect the inline dimension (horizontal in most writing modes) and generate separate LTR and RTL rules with appropriate direction selectors.
margin-inline → LTR: margin-left + margin-right, RTL: margin-right + margin-leftmargin-inline-start → LTR: margin-left, RTL: margin-rightmargin-inline-end → LTR: margin-right, RTL: margin-leftpadding-inline → LTR: padding-left + padding-right, RTL: padding-right + padding-leftpadding-inline-start → LTR: padding-left, RTL: padding-rightpadding-inline-end → LTR: padding-right, RTL: padding-leftborder-inline → LTR: border-left + border-right, RTL: border-right + border-leftborder-inline-start → LTR: border-left, RTL: border-rightborder-inline-end → LTR: border-right, RTL: border-leftborder-inline-width → LTR: border-left-width + border-right-width, RTL: border-right-width + border-left-widthborder-inline-style → LTR: border-left-style + border-right-style, RTL: border-right-style + border-left-styleborder-inline-color → LTR: border-left-color + border-right-color, RTL: border-right-color + border-left-colorborder-inline-start-width → LTR: border-left-width, RTL: border-right-widthborder-inline-start-style → LTR: border-left-style, RTL: border-right-styleborder-inline-start-color → LTR: border-left-color, RTL: border-right-colorborder-inline-end-width → LTR: border-right-width, RTL: border-left-widthborder-inline-end-style → LTR: border-right-style, RTL: border-left-styleborder-inline-end-color → LTR: border-right-color, RTL: border-left-colorinset-inline → LTR: left + right, RTL: right + leftinset-inline-start → LTR: left, RTL: rightinset-inline-end → LTR: right, RTL: leftinline-size → widthmin-inline-size → min-widthmax-inline-size → max-widthborder-start-start-radius → LTR: border-top-left-radius, RTL: border-top-right-radiusborder-start-end-radius → LTR: border-top-right-radius, RTL: border-top-left-radiusborder-end-start-radius → LTR: border-bottom-left-radius, RTL: border-bottom-right-radiusborder-end-end-radius → LTR: border-bottom-right-radius, RTL: border-bottom-left-radiusscroll-margin-inline → LTR: scroll-margin-left + scroll-margin-right, RTL: scroll-margin-right + scroll-margin-leftscroll-margin-inline-start → LTR: scroll-margin-left, RTL: scroll-margin-rightscroll-margin-inline-end → LTR: scroll-margin-right, RTL: scroll-margin-leftscroll-padding-inline → LTR: scroll-padding-left + scroll-padding-right, RTL: scroll-padding-right + scroll-padding-leftscroll-padding-inline-start → LTR: scroll-padding-left, RTL: scroll-padding-rightscroll-padding-inline-end → LTR: scroll-padding-right, RTL: scroll-padding-leftoverflow-inline → overflow-xoverscroll-behavior-inline → overscroll-behavior-xcontain-intrinsic-inline-size → contain-intrinsic-widthThese properties affect both block and inline dimensions and generate separate LTR and RTL rules.
inset → LTR: top + right + bottom + left, RTL: top + left + bottom + rightThe plugin also supports logical values for certain CSS properties:
/* Input */.element { float: inline-start; }
/* LTR Output */[dir="ltr"] .element { float: left; }
/* RTL Output */[dir="rtl"] .element { float: right; }/* Input */.element { clear: inline-start; }
/* LTR Output */[dir="ltr"] .element { clear: left; }
/* RTL Output */[dir="rtl"] .element { clear: right; }/* Input */.element { resize: block; }
/* Output (direction-independent) */.element { resize: vertical; }The plugin includes an integrated shim system that extends support for logical properties that weren’t originally supported by the core postcss-logical package.
All extended properties are supported by modern browsers (baseline 2022-2023) but the plugin provides fallbacks for older browsers that don’t support CSS logical properties yet.
The plugin includes experimental support for draft-stage CSS logical properties and features.
⚠️ Experimental Feature - Use with caution in production environments.
/* Input */.element { background: linear-gradient(to inline-start, red, blue);}
/* LTR Output */[dir="ltr"] .element { background: linear-gradient(to left, red, blue);}
/* RTL Output */[dir="rtl"] .element { background: linear-gradient(to right, red, blue);}Supported logical directions:
to inline-start → direction-aware to left/to rightto inline-end → direction-aware to right/to leftto block-start → to top (direction-independent)to block-end → to bottom (direction-independent)⚠️ Experimental Feature - Enhanced support for radial gradient logical positioning.
/* Simple logical positions */.element { background: radial-gradient(circle at inline-start, red, blue);}
/* LTR Output */[dir="ltr"] .element { background: radial-gradient(circle at left, red, blue);}
/* RTL Output */[dir="rtl"] .element { background: radial-gradient(circle at right, red, blue);}Advanced mixed positioning:
/* Mixed logical and physical positions */.element { background: radial-gradient(circle at inline-start top, red, blue);}
/* LTR Output */[dir="ltr"] .element { background: radial-gradient(circle at left top, red, blue);}
/* RTL Output */[dir="rtl"] .element { background: radial-gradient(circle at right top, red, blue);}Supported logical positions:
at inline-start → direction-aware at left/at rightat inline-end → direction-aware at right/at leftat block-start → at top (direction-independent)at block-end → at bottom (direction-independent)at inline-start top, at bottom inline-end, at 50% inline-start etc.Compound directions:
/* Compound logical positions */.element { background: radial-gradient(circle at inline-start block-end, red, blue);}
/* LTR Output */[dir="ltr"] .element { background: radial-gradient(circle at left bottom, red, blue);}
/* RTL Output */[dir="rtl"] .element { background: radial-gradient(circle at right bottom, red, blue);}⚠️ Experimental Feature - Full support for repeating gradient logical directions.
Both repeating-linear-gradient and repeating-radial-gradient support all the same logical directions as their non-repeating counterparts:
/* Repeating linear gradients */.stripes { background: repeating-linear-gradient(to inline-end, red 0%, blue 10px);}
/* LTR Output */[dir="ltr"] .stripes { background: repeating-linear-gradient(to right, red 0%, blue 10px);}
/* RTL Output */[dir="rtl"] .stripes { background: repeating-linear-gradient(to left, red 0%, blue 10px);}/* Repeating radial gradients */.pattern { background: repeating-radial-gradient(circle at inline-start, red 0%, transparent 15px);}
/* LTR Output */[dir="ltr"] .pattern { background: repeating-radial-gradient(circle at left, red 0%, transparent 15px);}
/* RTL Output */[dir="rtl"] .pattern { background: repeating-radial-gradient(circle at right, red 0%, transparent 15px);}All logical directions are supported:
repeating-linear-gradient with to inline-start/end, to block-start/endrepeating-radial-gradient with all logical positioning including mixed and compound directions/* Input */.content { margin-block: 2rem; padding-block-start: 1rem;}
/* Output - Single rule without direction selectors */.content { margin-top: 2rem; margin-bottom: 2rem; padding-top: 1rem;}/* Input */.container { margin-inline: 1rem; padding-inline-start: 1rem;}
/* Output - Separate LTR and RTL rules */.container { margin-left: 1rem; margin-right: 1rem;}[dir="ltr"] .container { padding-left: 1rem;}[dir="rtl"] .container { padding-right: 1rem;}/* Input */.element { inset: 10px;}
/* Output - LTR and RTL rules for mixed properties */[dir="ltr"] .element { top: 10px; right: 10px; bottom: 10px; left: 10px;}[dir="rtl"] .element { top: 10px; left: 10px; bottom: 10px; right: 10px;}