Skip to content

Supported Properties

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-blockmargin-top + margin-bottom
  • margin-block-startmargin-top
  • margin-block-endmargin-bottom
  • padding-blockpadding-top + padding-bottom
  • padding-block-startpadding-top
  • padding-block-endpadding-bottom
  • border-blockborder-top + border-bottom
  • border-block-startborder-top
  • border-block-endborder-bottom
  • border-block-widthborder-top-width + border-bottom-width
  • border-block-styleborder-top-style + border-bottom-style
  • border-block-colorborder-top-color + border-bottom-color
  • border-block-start-widthborder-top-width
  • border-block-start-styleborder-top-style
  • border-block-start-colorborder-top-color
  • border-block-end-widthborder-bottom-width
  • border-block-end-styleborder-bottom-style
  • border-block-end-colorborder-bottom-color
  • inset-blocktop + bottom
  • inset-block-starttop
  • inset-block-endbottom
  • block-sizeheight
  • min-block-sizemin-height
  • max-block-sizemax-height
  • scroll-margin-blockscroll-margin-top + scroll-margin-bottom
  • scroll-margin-block-startscroll-margin-top
  • scroll-margin-block-endscroll-margin-bottom
  • scroll-padding-blockscroll-padding-top + scroll-padding-bottom
  • scroll-padding-block-startscroll-padding-top
  • scroll-padding-block-endscroll-padding-bottom
  • overflow-blockoverflow-y
  • overscroll-behavior-blockoverscroll-behavior-y
  • contain-intrinsic-block-sizecontain-intrinsic-height

These 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-left
  • margin-inline-start → LTR: margin-left, RTL: margin-right
  • margin-inline-end → LTR: margin-right, RTL: margin-left
  • padding-inline → LTR: padding-left + padding-right, RTL: padding-right + padding-left
  • padding-inline-start → LTR: padding-left, RTL: padding-right
  • padding-inline-end → LTR: padding-right, RTL: padding-left
  • border-inline → LTR: border-left + border-right, RTL: border-right + border-left
  • border-inline-start → LTR: border-left, RTL: border-right
  • border-inline-end → LTR: border-right, RTL: border-left
  • border-inline-width → LTR: border-left-width + border-right-width, RTL: border-right-width + border-left-width
  • border-inline-style → LTR: border-left-style + border-right-style, RTL: border-right-style + border-left-style
  • border-inline-color → LTR: border-left-color + border-right-color, RTL: border-right-color + border-left-color
  • border-inline-start-width → LTR: border-left-width, RTL: border-right-width
  • border-inline-start-style → LTR: border-left-style, RTL: border-right-style
  • border-inline-start-color → LTR: border-left-color, RTL: border-right-color
  • border-inline-end-width → LTR: border-right-width, RTL: border-left-width
  • border-inline-end-style → LTR: border-right-style, RTL: border-left-style
  • border-inline-end-color → LTR: border-right-color, RTL: border-left-color
  • inset-inline → LTR: left + right, RTL: right + left
  • inset-inline-start → LTR: left, RTL: right
  • inset-inline-end → LTR: right, RTL: left
  • inline-sizewidth
  • min-inline-sizemin-width
  • max-inline-sizemax-width
  • border-start-start-radius → LTR: border-top-left-radius, RTL: border-top-right-radius
  • border-start-end-radius → LTR: border-top-right-radius, RTL: border-top-left-radius
  • border-end-start-radius → LTR: border-bottom-left-radius, RTL: border-bottom-right-radius
  • border-end-end-radius → LTR: border-bottom-right-radius, RTL: border-bottom-left-radius
  • scroll-margin-inline → LTR: scroll-margin-left + scroll-margin-right, RTL: scroll-margin-right + scroll-margin-left
  • scroll-margin-inline-start → LTR: scroll-margin-left, RTL: scroll-margin-right
  • scroll-margin-inline-end → LTR: scroll-margin-right, RTL: scroll-margin-left
  • scroll-padding-inline → LTR: scroll-padding-left + scroll-padding-right, RTL: scroll-padding-right + scroll-padding-left
  • scroll-padding-inline-start → LTR: scroll-padding-left, RTL: scroll-padding-right
  • scroll-padding-inline-end → LTR: scroll-padding-right, RTL: scroll-padding-left
  • overflow-inlineoverflow-x
  • overscroll-behavior-inlineoverscroll-behavior-x
  • contain-intrinsic-inline-sizecontain-intrinsic-width

These properties affect both block and inline dimensions and generate separate LTR and RTL rules.

  • inset → LTR: top + right + bottom + left, RTL: top + left + bottom + right

The 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 right
  • to inline-end → direction-aware to right/to left
  • to block-startto top (direction-independent)
  • to block-endto bottom (direction-independent)
/* 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;
}