<pre class='metadata'>
Title: CSS Logical Properties and Values Level 1
Shortname: css-logical
Level: 1
Status: ED
Work Status: Refining
Group: csswg
ED: https://drafts.csswg.org/css-logical-1/
TR: https://www.w3.org/TR/css-logical-1/
Previous version: https://www.w3.org/TR/2017/WD-css-logical-1-20170518/
Editor: Rossen Atanassov, Microsoft, ratan@microsoft.com, w3cid 49885
Editor: Elika J. Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact, w3cid 35400
Abstract: This module introduces logical properties and values that provide the author with the ability to control layout through logical, rather than physical, direction and dimension mappings. The module defines logical properties and values for the features defined in [[CSS21]]. These properties are writing-mode relative equivalents of their corresponding physical properties.
Ignored Terms: div, dl, dfn
Ignored Vars: *
Link Defaults: css2 (property) width/height/min-width/min-height/max-width/max-height
</pre>

<pre class="link-defaults">
spec:css-writing-modes-3; type:dfn; text:start
spec:css-writing-modes-3; type:dfn; text:end
</pre>

<style>
  @media (min-width: 40em) {
    #mapping-diagram figure {
      width: 49%;
      float: right;
    }
    #mapping-diagram figure:first-of-type {
      margin-right: 2%;
    }
  }
</style>


<h2 id="intro">
Introduction</h2>

  Note: See [[!css-writing-modes-4]] for a proper introduction to writing modes;
  this module assumes familiarity with its terminology.

  Because different writing systems are written in different directions,
  a variety of <a>writing modes</a> exist:
  left to right, top to bottom;
  right to left, top to bottom;
  bottom to top, right to left;
  etc.
  logical concepts like the “start” of a page or line
  map differently to physical concepts like the “top” of a line or “left edge” of a paragraph.
  Some aspects of a layout are actually relative to the writing directions,
  and thus will vary when the page is translated to a different system;
  others are inherently relative to the page's physical orientation.

  <div class="example">
    For example,
    lists, headings, and paragraphs are typically left-aligned in English;
    but actually they are start-aligned, because in Arabic the same constructs are right-aligned,
    and a multilingual document will need to accommodate both writing systems accordingly.

    The following code examplify how using logical syntax can help you write code 
        that works across different writing systems:

    <figure>
        <img src="./images/example01.png" width="300" height="109" />
        <figcaption>Rendering of the below code in a compatible browser</figcaption>
    </figure>

    <xmp highlight="html">
        <blockquote dir="auto">Quotation in English</blockquote>
        <blockquote dir="auto">اقتباس في العربية</blockquote>
    </xmp>

    <xmp highlight="css">

        blockquote {
            text-align: start; /* left in latin, right in arabic */
            margin-inline-start: 0px; /* margin-left in latin, margin-right in arabic */
            border-inline-start: 5px solid gray; /* border-left in latin, border-right in arabic */
            padding-inline-start: 5px; /* padding-left in latin, padding-right in arabic */
        }

    </xmp>

    Documents might need both logical and physical properties. For instance
      the drop shadows on buttons on a page must remain consistent throughout,
      so their offset will be chosen based on visual considerations and physical directions,
      and not vary by writing system.

  </div>

  Since CSS was originally designed with only physical coordinates in its controls,
  this module introduces text-flow&ndash;relative equivalents
  so that declarations in a CSS style sheet can be expressed
  in <a>flow-relative</a> terms.
  It defines the mapping and cascading of equivalent properties,
  some new properties and values equivalent to those in CSS2.1,
  and the principles used to derive their syntaxes.
  Future CSS specifications are expected to incorporate both sets of coordinates
  in their property and value definitions,
  so this module will not track the introduction of <a>flow-relative</a> variants
  of newer CSS features.

  <a href="http://www.w3.org/TR/css-writing-modes/">CSS Writing Modes</a>’ <a href="https://www.w3.org/TR/css-writing-modes-3/#abstract-box">Abstract Box Terminology</a> section
  defines how to map between flow-relative and physical terms.
  This mapping,
  which depends on the <a>used values</a> of 'writing-mode' and 'direction',
  controls the interpretation of flow-relative keywords and properties.

  <div id="mapping-diagram">
    <figure>
      <img src="diagrams/sizing-ltr-tb.svg">
      <figcaption>
        Correspondence of physical and flow-relative terms in typical English text layout
      </figcaption>
    </figure>
    <figure>
      <img src="diagrams/sizing-ttb-rl.svg">
      <figcaption>
        Correspondence of physical and flow-relative terms in typical Chinese text layout
      </figcaption>
    </figure>
  </div>

  Note: Due to its interaction with ''text-orientation: upright'',
  the <a lt="used value">used</a> 'direction'
  depends on the <a>computed values</a> of 'writing-mode' and 'text-orientation'.

<div class="issue">
  <strong>Things That Are Unstable</strong>
  Since implementation of parts of this module is effectively required
  for shipping an implementation of <a href="https://www.w3.org/TR/css-writing-modes-3/">CSS Writing Modes</a> on the Web
  (in order to correctly implement the default HTML styles),
  the CSSWG resolved that
  the requisite features in
  <a href="#directional-keywords"></a> and <a href="#box"></a>
  are approved for shipping.
  (See <a href="https://lists.w3.org/Archives/Public/www-style/2017Dec/0043.html">FPWD announcement</a> for additional background.)

  However, there are a few significant open issues:
  <ul>
    <li>The ''border/logical'' keyword on shorthands,
        because the name of the keyword may change or it may be replaced by some other syntactic marker.
        (This feature will be deferred from this level for further development
        if there is no clearly satisfactory mechanism proposed,
        see <a href="https://github.com/w3c/csswg-drafts/issues/1282">Issue 1282</a>.)
    <li>Whether flow-relative longhands inherit from their namesake on the parent,
        or are mapped to a physical property and inherit from that property.
        (See <a href="https://github.com/w3c/csswg-drafts/issues/3029">Issue 3029</a>.)
    <li>Whether shorthands like 'margin' expand to both sets of longhands,
        or only the ones that were set.
        (See <a href="https://github.com/w3c/csswg-drafts/issues/3030">Issue 3030</a>.)
  </ul>
  Comments, suggestions, and use cases are welcome on these issues.
  Please file them in GitHub, tweet them to @csswg, or send them to www-style@w3.org.
</div>

<h2 id="directional-keywords">
Flow-Relative Values: <css>block-start</css>, <css>block-end</css>, <css>inline-start</css>, <css>inline-end</css></h2>

  Properties that accept physical directional keyword values
  ('top', 'bottom', 'left', or 'right') are redefined
  to also accept the appropriate <a>flow-relative</a> directional keywords.
  In such cases,
  the flow-relative values can be used in place of the corresponding physical values.
  For properties that take multiple keywords,
  combinations of flow-relative and physical values are not allowed
  (unless otherwise specified in a future specification).

  Properties can be either 1-dimensional or 2-dimensional.
  When contextually constrained to one dimension,
  the flow-relative keywords are abbreviated.

<h3 id="caption-side">
Logical Values for the 'caption-side' Property</h3>

  <pre class="propdef partial">
    Name: caption-side
    New values: inline-start | inline-end
    Computed value: specified keyword
  </pre>

  These two values are added only for implementations that support
  ''caption-side/left'' and ''caption-side/right'' values for 'caption-side'.
  The ''caption-side/left'' and ''caption-side/right'' values themselves
  are defined to be <a>line-relative</a>.

  The existing ''caption/top'' and ''caption/bottom'' values are idiosyncratically redefined
  as assigning to the <a>block-start</a> and <a>block-end</a> sides of the table, respectively.

  The mapping on this property uses the <a>writing mode</a> of the caption’s <a>containing block</a>
  (that is, the <a>table wrapper box</a>).

<h3 id="float-clear">
Flow-Relative Values for the 'float' and 'clear' Properties</h3>

  <pre class="propdef partial">
    Name: float, clear
    New values: inline-start | inline-end
    Computed value: specified keyword
  </pre>

  The mapping on these properties uses the <a>writing mode</a> of the element’s <a>containing block</a>.

  Note: These properties are 1-dimensional in CSS2,
  but are planned to be expanded to two dimensions,
  and therefore are given unabbreviated <a>flow-relative</a> keywords.

<h3 id="text-align">
Flow-Relative Values for the 'text-align' Property</h3>

  <pre class="propdef partial">
    Name: text-align
    New values: start | end
    Computed value: specified keyword
  </pre>

  These values are normatively defined in [[!css-text-3]].

<h3 id="resize">
Flow-Relative Values for the 'resize' Property</h3>

  <pre class="propdef partial">
    Name: resize
    New values: block | inline
    Computed value: specified keyword
  </pre>

<h2 id="page">
Flow-Relative Page Classifications</h2>

  In CSS, all pages are classified by user agents as either left pages or right pages. [[!CSS21]]
  Which page is first in a spread, however,
  depends on whether the page progression is left-to-right or right-to-left.

  To allow control of page breaking to the page
  that is on the earlier or later side of a spread,
  rather than to the left or right side of a spread,
  this module introduces the following additional keywords
  for the 'page-break-after' and 'page-break-before' properties [[!CSS21]]:

  <dl dfn-type="value" dfn-for="logical-page">
    <dt><dfn>recto</dfn>
      <dd>
        Equivalent to 'right' in left-to-right page progressions
        and 'left' in right-to-left page progressions.

    <dt><dfn>verso</dfn>
      <dd>
        Equivalent to 'left' in left-to-right page progressions
        and 'right' in right-to-left page progressions.
  </dl>

  These values are computed as specified
  and are further defined in [[!css-break-3]].

  Although authors typically place page numbers using physical placements,
  the contents of headers often follows conventions depending
  on which page in the spread is earlier.
  Therefore the following flow-relative <a href="https://www.w3.org/TR/CSS21/page.html#page-selectors">page selectors</a>
  are also added to support flow-relative page selection:

  <dl dfn-type="value" dfn-for="logical-page-selector">
    <dt><dfn>:recto</dfn>
      <dd>
        Equivalent to ':right' in left-to-right page progressions
        and ':left' in right-to-left page progressions.

    <dt><dfn>:verso</dfn>
      <dd>
        Equivalent to ':left' in left-to-right page progressions
        and ':right' in right-to-left page progressions.
  </dl>

  The flow-relative page selectors have specificity equal to
  the ':left' and ':right' page selectors.

<h2 id="box">
Flow-Relative Box Model Properties</h2>

  This specification introduces new CSS properties
  that are <a>flow-relative</a> equivalents
  of <a>physical</a> box model properties.
  Each set of related flow-relative longhand properties
  and their parallel physical properties
  form a <dfn export>logical property group</dfn>.
  For example, the 'padding-*' properties
  form a single <a>logical property group</a>,
  the 'margin-*' properties
  form a separate <a>logical property group</a>,
  etc.
  The type of directional or axis mapping
  (<a>flow-relative</a> or <a>physical</a>)
  is called the property’s <dfn export>mapping logic</dfn>.

  Note: Each longhand property is in at most one <a>logical property group</a>.

  The <a>specified values</a> of the <a>flow-relative</a> properties
  are distinct from
  the specified values of the parallel physical properties,
  but the flow-relative and physical properties share computed values.
  Which pairs of properties share computed values
  depends on the element’s computed values of
  'writing-mode', 'direction', and 'text-orientation'.

  Note: Depending on the element’s own <a>writing mode</a>
  for mapping every <a>flow-relative</a> property
  to its <a>physical</a> equivalent
  simplifies the cascading calculations
  and gives a straightforward model for authors to reason about.
  However, it is problematic in many cases,
  see for example <a href="https://www.w3.org/mid/20161108202634.GA7235@mail.internode.on.net">this discussion</a>.
  Authors may need to use nested elements
  to get the correct mapping behavior
  when changing an element’s <a>writing mode</a> from its parent.

  A computed value that has flow-relative and physical properties as input
  is determined by applying the CSS cascade to declarations of both.
  Overriding is not determined by whether a declaration is flow-relative or physical,
  but only by the rules of the CSS cascade [[!css-cascade-3]].

  <p class="note">
    Note that this requires implementations to maintain
    relative order of declarations within a CSS declaration block,
    which was not previously required for CSS cascading.
  </p>

  <div class="example">
    For example, given the following rule:

    <pre class="lang-css">
      p {
        margin-inline-start: 1px;
        margin-left: 2px;
        margin-inline-end: 3px;
      }
    </pre>

    In a paragraph with computed 'writing-mode' being ''horizontal-tb''
    and computed 'direction' being ''ltr'',
    the computed value of 'margin-left' is ''2px'',
    since for that 'writing-mode' and 'direction',
    'margin-inline-start' and 'margin-left' share a computed value,
    and the declaration of 'margin-left'
    is after the declaration of 'margin-inline-start'.
    However, if the computed 'direction' were instead ''rtl'',
    the computed value of 'margin-left' is ''3px'',
    since 'margin-inline-end' and 'margin-left' share a computed value,
    and the declaration of 'margin-inline-end'
    is after the declaration of 'margin-left'.
  </div>

  [[!CSSOM]] APIs that return computed values
  (such as <code>getComputedStyle()</code>)
  must return the same value for equivalent pairs of such properties.

  ISSUE: There are some open questions on
  the <a href="https://github.com/w3c/csswg-drafts/issues/3029">order of inheritance vs mapping in flow-relative properties</a>
  and on the <a href="https://github.com/w3c/csswg-drafts/issues/3030">interaction of shorthands and logical properties</a>.

<h3 id="dimension-properties">
Logical Height and Logical Width:
the 'block-size'/'inline-size',
'min-block-size'/'min-inline-size',
and 'max-block-size'/'max-inline-size' properties</h3>

  <pre class="propdef">
  Name: block-size, inline-size
  Value: <<'width'>>
  Initial: auto
  Applies to: Same as 'height' and 'width'
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as 'height', 'width'
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'height' and 'width' properties.
  The mapping depends on the element's 'writing-mode'.

  <pre class="propdef">
  Name: min-block-size, min-inline-size
  Value: <<'min-width'>>
  Initial: 0
  Applies to: same as 'height' and 'width'
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as 'min-height', 'min-width'
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'min-height' and 'min-width' properties.
  The mapping depends on the element's 'writing-mode'.

  <pre class="propdef">
  Name: max-block-size, max-inline-size
  Value: <<'max-width'>>
  Initial: none
  Applies to: same as 'height' and 'width'
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as 'max-height', 'max-width'
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'max-height' and 'max-width' properties.
  The mapping depends on the element's 'writing-mode'.

<h3 id="margin-properties">
Flow-relative Margins:
the 'margin-block-start', 'margin-block-end', 'margin-inline-start', 'margin-inline-end' properties and 'margin-block' and 'margin-inline' shorthands</h3>

  <pre class="propdef">
  Name: margin-block-start, margin-block-end, margin-inline-start, margin-inline-end
  Value: <<'margin-top'>>
  Initial: 0
  Applies to: Same as 'margin-top'
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as corresponding 'margin-*' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the 'margin-top', 'margin-bottom', 'margin-left', and 'margin-right' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: margin-block, margin-inline
  Value: <<'margin-top'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'margin-block-start' &amp; 'margin-block-end'
  and
  'margin-inline-start' &amp; 'margin-inline-end',
  respectively.
  The first value represents the <a>start</a> edge style,
  and the second value represents the <a>end</a> edge style.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.

<h3 id="position-properties">
Flow-relative Offsets:
the 'inset-block-start', 'inset-block-end', 'inset-inline-start', 'inset-inline-end' properties and 'inset-block', 'inset-inline', and 'inset' shorthands</h3>

  The 'top', 'left', 'bottom', 'right' physical properites,
  their 'inset-block-start', 'inset-block-end', 'inset-inline-start', 'inset-inline-end' flow-relative correspondants,
  and the 'inset-block', 'inset-inline', and 'inset' shorthands,
  are colectively known as the <dfn export>inset properties</dfn>.

  <pre class="propdef">
  Name: inset-block-start, inset-block-end, inset-inline-start, inset-inline-end
  Value: <<'top'>>
  Initial: auto
  Applies to: positioned elements
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as corresponding 'top'/'right'/'bottom'/'left' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'top', 'bottom', 'left', and 'right' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: inset-block, inset-inline
  Value: <<'top'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'inset-block-start' &amp; 'inset-block-end'
  and
  'inset-inline-start' &amp; 'inset-inline-end',
  respectively.
  The first value represents the <a>start</a> edge style,
  and the second value represents the <a>end</a> edge style.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.

  <pre class="propdef shorthand">
  Name: inset
  Value: <<'top'>>{1,4}
  </pre>

  This <a>shorthand property</a> sets the
  'top', 'right', 'bottom', and 'left' properties.
  Values are assigned to its <a>sub-properties</a> as for 'margin'.

<h3 id="padding-properties">
Flow-relative Padding:
the 'padding-block-start', 'padding-block-end', 'padding-inline-start', 'padding-inline-end' properties and 'padding-block' and 'padding-inline' shorthands</h3>

  <pre class="propdef">
  Name: padding-block-start, padding-block-end, padding-inline-start, padding-inline-end
  Value: <<'padding-top'>>
  Initial: 0
  Applies to: all elements
  Inherited: no
  Percentages: As for the corresponding physical property
  Computed value: Same as corresponding 'padding-*' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'padding-top', 'padding-bottom', 'padding-left', and 'padding-right' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: padding-block, padding-inline
  Value: <<'padding-top'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'padding-block-start' &amp; 'padding-block-end'
  and
  'padding-inline-start' &amp; 'padding-inline-end',
  respectively.
  The first value represents the <a>start</a> edge style,
  and the second value represents the <a>end</a> edge style.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.

<h3 id="border-properties">
Flow-relative Borders</h3>

<h4 id="border-width">
Flow-relative Border Widths:
the 'border-block-start-width', 'border-block-end-width', 'border-inline-start-width', 'border-inline-end-width' properties and 'border-block-width' and 'border-inline-width' shorthands</h4>

  <pre class="propdef">
  Name: border-block-start-width, border-block-end-width, border-inline-start-width, border-inline-end-width
  Value: <<'border-top-width'>>
  Initial: medium
  Applies to: all elements
  Inherited: no
  Percentages: n/a
  Computed value: Same as corresponding 'border-*-width' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'border-top-width', 'border-bottom-width', 'border-left-width', and 'border-right-width' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: border-block-width, border-inline-width
  Value: <<'border-top-width'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'border-block-start-width' &amp; 'border-block-end-width'
  and
  'border-inline-start-width' &amp; 'border-inline-end-width',
  respectively.
  The first value represents the <a>start</a> edge width,
  and the second value represents the <a>end</a> edge width.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.


<h4 id="border-style">
Flow-relative Border Styles:
the 'border-block-start-style', 'border-block-end-style', 'border-inline-start-style', 'border-inline-end-style' properties and 'border-block-style' and 'border-inline-style' shorthands</h4>

  <pre class="propdef">
  Name: border-block-start-style, border-block-end-style, border-inline-start-style, border-inline-end-style
  Value: <<'border-top-style'>>
  Initial: none
  Applies to: all elements
  Inherited: no
  Percentages: n/a
  Computed value: Same as corresponding 'border-*-style' properties
  Animation type: discrete
  </pre>

  These properties correspond to the
  'border-top-style', 'border-bottom-style', 'border-left-style', and 'border-right-style' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: border-block-style, border-inline-style
  Value: <<'border-top-style'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'border-block-start-style' &amp; 'border-block-end-style'
  and
  'border-inline-start-style' &amp; 'border-inline-end-style',
  respectively.
  The first value represents the <a>start</a> edge style,
  and the second value represents the <a>end</a> edge style.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.

<h4 id="border-color">
Flow-relative Border Colors:
the 'border-block-start-color', 'border-block-end-color', 'border-inline-start-color', 'border-inline-end-color' properties and 'border-block-color' and 'border-inline-color' shorthands</h4>

  <pre class="propdef">
  Name: border-block-start-color, border-block-end-color, border-inline-start-color, border-inline-end-color
  Value: <<'border-top-color'>>
  Initial: currentcolor
  Applies to: all elements
  Inherited: no
  Percentages: n/a
  Computed value: Same as corresponding 'border-*-color' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'border-top-color', 'border-bottom-color', 'border-left-color', and 'border-right-color' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: border-block-color, border-inline-color
  Value: <<'border-top-color'>>{1,2}
  </pre>

  These two <a>shorthand properties</a> set the
  'border-block-start-color' &amp; 'border-block-end-color'
  and
  'border-inline-start-color' &amp; 'border-inline-end-color',
  respectively.
  The first value represents the <a>start</a> edge style,
  and the second value represents the <a>end</a> edge style.
  If only one value is given, it applies to both the <a>start</a> and <a>end</a> edges.

<h4 id="border-shorthands">
Flow-relative Border Shorthands:
the 'border-block-start', 'border-block-end', 'border-inline-start', 'border-inline-end' properties and 'border-block' and 'border-inline' shorthands</h4>

  <pre class="propdef shorthand">
  Name: border-block-start, border-block-end, border-inline-start, border-inline-end
  Value: <<'border-top-width'>> || <<'border-top-style'>> || <<color>>
  </pre>

  These properties correspond to the
  'border-top', 'border-bottom', 'border-left', and 'border-right' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

  <pre class="propdef shorthand">
  Name: border-block, border-inline
  Value: <<'border-block-start'>>
  </pre>

  These two <a>shorthand properties</a> set the
  'border-block-start' &amp; 'border-block-end'
  and
  'border-inline-start' &amp; 'border-inline-end',
  respectively.

<h3 id="border-radius-properties">
Flow-relative Corner Rounding:
the 'border-start-start-radius', 'border-start-end-radius', 'border-end-start-radius', 'border-end-end-radius' properties</h3>

  <pre class="propdef">
  Name: border-start-start-radius, border-start-end-radius, border-end-start-radius, border-end-end-radius
  Value: <<'border-top-left-radius'>>
  Initial: Same as 'border-top-left-radius'
  Applies to: all elements
  Inherited: no
  Percentages: Same as 'border-top-left-radius'
  Computed value: Same as corresponding physical 'border-*-radius' properties
  Animation type: by computed value type
  </pre>

  These properties correspond to the
  'border-top-left-radius', 'border-bottom-left-radius', 'border-top-right-radius', and 'border-bottom-right-radius' properties.
  The mapping depends on the element's 'writing-mode', 'direction', and 'text-orientation'.

<h3 id="logical-shorthand-keyword">
Four-Directional Shorthand Properties: the 'margin', 'padding', 'border-width', 'border-style', and 'border-color' shorthands</h3>

  The shorthand properties for margin, padding, and border
  set values for physical properties by default.
  But authors can specify
  the <dfn value for="margin, padding, border-color, border-style, border-width">logical</dfn> keyword
  at the beginning of the property value
  to indicate that the values map to the flow-relative properties instead of the physical ones.

  <p class="issue">
    The proposed syntax for this feature is <a href="https://github.com/w3c/csswg-drafts/issues/1282">under discussion</a>
    and is almost guaranteed to change from what is described here.
    This section remains in the draft to promote discussion of alternatives,
    to document the affected properties,
    and to specify the expected impact on the interpretation
    of whatever syntactic switch is ultimately chosen.

  The following [[!CSS21]] shorthand properties
  accept the ''margin/logical'' keyword:
  <ul>
    <li>'inset'
    <li>'margin'
    <li>'padding'
    <li>'border-width'
    <li>'border-style'
    <li>'border-color'
    <li>'scroll-padding'
    <li>'scroll-margin'
  </ul>

  The syntax for these properties is effectively changed by replacing
    <pre class="prod">&lt;<var>value-type</var>&gt;{1,4}</pre>

  with
    <pre class="prod">logical? &lt;<var>value-type</var>&gt;{1,4}</pre>

  When the ''margin/logical'' keyword is present in the value,
  the values that follow are assigned to its flow-relative longhands
  as follows:

  <ul>
    <li>If only one value is set, the value applies to all four flow-relative <a>longhands</a>.
    <li>If two values are set, the first is for block-start and block-end,
      the second is for inline-start and inline-end.
    <li>If three values are set, the first is for block-start,
      the second is for inline-start and inline-end,
      and the third is for block-end.
    <li>If four values are set, they apply to
      the block-start, inline-start, block-end, and inline-end sides
      in that order.
  </ul>

  <div class="example">
    In the following example, the two rules are equivalent:

    <pre class="lang-css">
      blockquote {
        margin: logical 1em 2em 3em 4em;
      }
      blockquote {
        margin-block-start:  1em;
        margin-inline-start: 2em;
        margin-block-end:    3em;
        margin-inline-end:   4em;
      }
    </pre>
  </div>

<h2 id="acknowledgements">Acknowledgements</h2>

  Cameron McCormack, David Baron, Shinyu Murakami, Tab Atkins

<h2 id="changes">
Changes</h2>

  Changes since the previous Working Draft include:
  <ul>
    <li>Removing the features for logical background and border-images.
        (These ideas may be revisited in a future draft.)
    <li>Adding the logical 'border-radius' longhands.
  </ul>

  Changes between the earlier Editors Drafts and the <a href="https://www.w3.org/TR/2017/WD-css-logical-1-20170518/">18 May 2017 First Public Working Draft</a> include:
  <ul>
    <li>Making all properties cascade using the <a>writing mode</a> specified on the element, not on its parent.
    <li>Making the ordering of longhands within 'margin'-like shorthands put inline-start before inline-end.
    <li>Adding the '*-inline' and '*-block' shorthand forms for margins/borders/padding.
    <li>Renaming the <css>offset-*</css> properties to 'inset-*' and marking an issue for discussion.
    <li>Adding an Introduction section.
    <li>Updating to current terminology of CSS Writing Modes.
    <li>Miscellaneous prose cleanup.
  </ul>
