CSS Logical Properties Level 1

Editor’s Draft,

This version:
https://drafts.csswg.org/css-logical-props/
Issue Tracking:
Inline In Spec
GitHub Issues
Editors:
(Microsoft)
Elika J. Etemad / fantasai (Invited Expert)

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.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc.

Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

GitHub Issues are preferred for discussion of this specification. When filing an issue, please put the text “css-logical-props” in the title, preferably like this: “[css-logical-props] …summary of comment…”. All issues and comments are archived, and there is also a historical archive.

This document was produced by the CSS Working Group (part of the Style Activity).

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 March 2017 W3C Process Document.

CSS Logical Properties Level 1

Introduction

Note: See [CSS3-WRITING-MODES] 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 writing modes 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.

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. However 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.

Since CSS was originally designed with only physical coordinates in its controls, this module introduces text-flow–relative equivalents so that declarations in a CSS style sheet can be expressed in flow-relative 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 flow-relative variants of newer CSS features.

CSS Writing ModesAbstract Box Terminology section defines how to map between flow-relative and physical terms. This mapping controls the interpretation of flow-relative keywords and properties.

Things That Are Unstable Since implementation of parts of this module is effectively required for shipping an implementation of CSS Writing Modes on the Web (in order to correctly implement the default HTML styles), The CSSWG resolved that although the draft is not very stable overall, the requisite features in §1 Flow-Relative Values: block-start, block-end, inline-start, inline-end and §3 Flow-Relative Box Model Properties are approved for shipping. However, there are a number of unstable features in this draft (which are not required for implementing the HTML default style sheet, incidentally), and these are: Comments and suggestions are welcome on these issues. Please file them in GitHub, tweet them to @csswg, or send them to www-style@w3.org.

1. Flow-Relative Values: block-start, block-end, inline-start, inline-end

Properties that accept physical directional keyword values (top, bottom, left, or right) are redefined to also accept the appropriate flow-relative 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.

1.1. Logical Values for the caption-side Property

Name: caption-side
New values: inline-start | inline-end

These two values are added only for implementations that support left and right values for caption-side. The existing top and bottom values are idiosyncratically redefined as assigning to the block-start and block-end sides of the table, respectively. The mapping on this property uses the writing mode of the element’s containing block (that is, the table wrapper box).

1.2. Flow-Relative Values for the float and clear Properties

Name: float, clear
New values: inline-start | inline-end

The mapping on this property uses the writing mode of the element’s containing block.

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

1.3. Flow-Relative Values for the text-align Property

Name: text-align
New values: start | end

These values are normatively defined in [CSS3TEXT].

1.4. Flow-Relative Values for the resize Property

Name: resize
New values: block | inline

2. Flow-Relative Page Classifications

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]:

recto
Equivalent to right in left-to-right page progressions and left in right-to-left page progressions.
verso
Equivalent to left in left-to-right page progressions and right in right-to-left page progressions.

These values are further defined in [CSS3-BREAK].

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 page selectors are also added to support flow-relative page selection:

:recto
Equivalent to ':right' in left-to-right page progressions and ':left' in right-to-left page progressions.
:verso
Equivalent to ':left' in left-to-right page progressions and ':right' in right-to-left page progressions.

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

3. Flow-Relative Box Model Properties

This specification introduces new CSS properties that are flow-relative equivalents of physical box model properties.

The specified values of these properties are separate 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.

Depending on the element’s own writing mode simplifies the cascading calculations and gives a straightforward model for authors to reason about. However, it is problematic in many cases, see for example this discussiona.

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 [CSS3-CASCADE].

Note that this requires implementations to maintain relative order of declarations within a CSS declaration block, which was not previously required for CSS cascading.

For example, given the following rule:
p {
  margin-inline-start: 1px;
  margin-left: 2px;
  margin-inline-end: 3px;
}

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.

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

3.1. Logical Height and Logical Width: the block-size and inline-size properties

Name: block-size, inline-size
Value: <‘width’>
Initial: auto
Applies to: Same as width and height
Inherited: No
Percentages: As for the corresponding physical property
Media: visual
Computed value: Same as width and height
Canonical order: per grammar
Animation type: discrete

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

Name: min-block-size, min-inline-size
Value: <‘min-width’>
Initial: 0
Applies to: same as width and height
Inherited: No
Percentages: As for the corresponding physical property
Media: visual
Computed value: Same as min-width and min-height
Canonical order: per grammar
Animation type: discrete

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

Name: max-block-size, max-inline-size
Value: <‘max-width’>
Initial: none
Applies to: same as width and height
Inherited: no
Percentages: As for the corresponding physical property
Media: visual
Computed value: Same as max-width and max-height
Canonical order: per grammar
Animation type: discrete

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

3.2. Flow-relative Margins: the margin-block-start, margin-block-end, margin-inline-start, margin-inline-end properties and margin-block and margin-inline shorthands

Name: margin-block-start, margin-block-end, margin-inline-start, margin-inline-end
Value: <‘margin-left’>
Initial: 0
Applies to: Same as margin
Inherited: no
Percentages: As for the corresponding physical property
Media: visual
Computed value: the percentage as specified or the absolute length or auto (see text)
Canonical order: per grammar
Animation type: discrete

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.

Name: margin-block, margin-inline
Value: <‘margin-left’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.3. 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

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
Media: visual
Computed value: Same as box offsets: top, right, bottom, left properties except that directions are flow-relative
Canonical order: per grammar
Animation type: discrete

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

Name: inset-block, inset-inline
Value: <‘top’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

Name: inset
Value: <‘top’>{1,4}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.4. Flow-relative Padding: the padding-block-start, padding-block-end, padding-inline-start, padding-inline-end properties and padding-block and padding-inline shorthands

Name: padding-block-start, padding-block-end, padding-inline-start, padding-inline-end
Value: <‘padding-left’>
Initial: 0
Applies to: all elements
Inherited: no
Percentages: As for the corresponding physical property
Media: visual
Computed value: length (see text)
Canonical order: per grammar
Animation type: discrete

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.

Name: padding-block, padding-inline
Value: <‘padding-left’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.5. Flow-relative Borders

3.5.1. 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

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
Media: visual
Computed value: absolute length; 0 if the border style is none or hidden (see text)
Canonical order: per grammar
Animation type: discrete

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.

Name: border-block-width, border-inline-width
Value: <‘border-top-width’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.5.2. 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

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
Media: visual
Computed value: specified value (see text)
Canonical order: per grammar
Animation type: discrete

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.

Name: border-block-style, border-inline-style
Value: <‘border-top-style’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.5.3. 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

Name: border-block-start-color, border-block-end-color, border-inline-start-color, border-inline-end-color
Value: color
Initial: currentcolor
Applies to: all elements
Inherited: no
Percentages: n/a
Media: visual
Computed value: computed color (see text)
Canonical order: per grammar
Animation type: discrete

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.

Name: border-block-color, border-inline-color
Value: <‘border-top-color’>{1,2}
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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

3.5.4. 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

Name: border-block-start, border-block-end, border-inline-start, border-inline-end
Value: <‘border-top-width’> || <‘border-top-style’> || <color>
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

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.

Name: border-block, border-inline
Value: <‘border-block-start’>
Initial: see individual properties
Applies to: see individual properties
Inherited: see individual properties
Percentages: see individual properties
Media: see individual properties
Computed value: see individual properties
Animation type: see individual properties
Canonical order: per grammar

These two shorthand properties set the border-block-start-color & border-block-end-color and border-inline-start-color & border-inline-end-color, respectively.

3.6. Four-Directional Shorthand Properties: the margin, padding, border-width, border-style, and border-color shorthands

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

other candidates of the keyword are: relative, script, writing-mode, beas, or the value itself (e.g., vertical-lr-ltr)

The following [CSS21] shorthand properties (and additionally the new inset shorthand defined above) accept the logical keyword:

The syntax for these properties is effectively changed by replacing

<value-type>{1,4}

with

logical? <value-type>{1,4}

When the logical keyword is present in the value, the values that follow are assigned to the flow-relative properties as follows:

In the following example, the two rules are equivalent:
blockquote {
  margin: logical 1em 2em 3em 4em;
}
blockquote {
  margin-block-start:  1em;
  margin-inline-start: 2em;
  margin-block-end:    3em;
  margin-inline-end:   4em;
}

4. Logical Background and Border Images

[CSS3BG] is handled separately because it can fill an area with specified images, and the area to fill can be rotated or flipped depending on the text flow.

4.1. Background Image Transform: The background-image-transform property

Name: background-image-transform
Value: logical | physical | rotate
Initial: physical
Applies to: all elements
Inherited: yes
Percentages: n/a
Media: visual
Computed value: as specified
Canonical order: per grammar
Animation type: discrete

is this the right default? we need to investigate which is more common

This property defines whether background images are transformed to match to the value of writing-mode property, and whether background-size widths and heights are flow-relative or physical. Values have the following meanings:

logical
The values for the background-size property are flow-relative. The background images are transformed to match to the flow-relative axis.
physical
The values for the background-size property are physical. The background images remain unchanged.
rotate
Similar to logical, except that the inline base direction is ignored. The result is affected only by the block flow direction.

4.2. The background-repeat property

The repeat-x and repeat-y values are physical, but in CSS3 this property can also accept double values to specify horizontal and vertical behaviors separately. The double values are considered flow-relative if the logical keyword is specified, otherwise physical.

should also add repeat-horizontal and repeat-vertical for the physical value?

4.3. Border Image Transform: The border-image-transform property

Name: border-image-transform
Value: logical | physical | rotate
Initial: rotate
Applies to: All elements, except internal table elements when border-collapse is collapse
Inherited: yes
Percentages: n/a
Media: visual
Computed value: as specified
Canonical order: per grammar
Animation type: discrete

is this the right initial default?

This property defines whether border images are transformed to match to the value of writing-mode property, with the reference writing mode being writing-mode: horizontal-tb; direction: ltr. Values have the following meanings:

logical
The values for the border-image-* properties are flow-relative. The border images are transformed to match to the flow-relative axis.
physical
The values for the border-image-* properties are physical. The border images remain unchanged.
rotate
Similar to logical, except that the inline base direction is ignored. The result is affected only by the block flow direction.

The following properties use the value of this property to determine how directional mappings are done:

5. Changes

Changes since the earler Editors Drafts include:

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <strong class="advisement">, like this: UAs MUST provide an accessible alternative.

Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
A CSS style sheet.
renderer
A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

Requirements for Responsible Implementation of CSS

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.

Partial Implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

Implementations of Unstable and Proprietary Features

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

Implementations of CR-level Features

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

Index

Terms defined by this specification

Terms defined by reference

References

Normative References

[CSS-BACKGROUNDS-3]
CSS Backgrounds and Borders Module Level 3 URL: https://www.w3.org/TR/css3-background/
[CSS-CASCADE-4]
Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 4. URL: https://www.w3.org/TR/css-cascade-4/
[CSS-COLOR-3]
CSS Color Module Level 3 URL: https://www.w3.org/TR/css3-color/
[CSS-DISPLAY-3]
Elika Etemad. CSS Display Module Level 3. URL: https://www.w3.org/TR/css-display-3/
[CSS-POSITION-3]
Rossen Atanassov; Arron Eicholz. CSS Positioned Layout Module Level 3. URL: https://www.w3.org/TR/css-position-3/
[CSS-RUBY-1]
Elika Etemad; Koji Ishii. CSS Ruby Layout Module Level 1. URL: https://www.w3.org/TR/css-ruby-1/
[CSS-UI-3]
Tantek Çelik; Florian Rivoal. CSS Basic User Interface Module Level 3 (CSS3 UI). URL: https://www.w3.org/TR/css-ui-3/
[CSS-VALUES-3]
Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 3. URL: https://www.w3.org/TR/css-values-3/
[CSS-WRITING-MODES-4]
CSS Writing Modes Module Level 4 URL: https://drafts.csswg.org/css-writing-modes-4/
[CSS21]
Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. 7 June 2011. REC. URL: https://www.w3.org/TR/CSS2
[CSS22]
Bert Bos. Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification. URL: https://www.w3.org/TR/CSS22/
[CSS3-BREAK]
Rossen Atanassov; Elika Etemad. CSS Fragmentation Module Level 3. URL: https://www.w3.org/TR/css-break-3/
[CSS3-CASCADE]
Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 3. URL: https://www.w3.org/TR/css-cascade-3/
[CSS3-WRITING-MODES]
Elika Etemad; Koji Ishii. CSS Writing Modes Level 3. URL: https://www.w3.org/TR/css-writing-modes-3/
[CSS3BG]
Bert Bos; Elika Etemad; Brad Kemper. CSS Backgrounds and Borders Module Level 3. URL: https://www.w3.org/TR/css3-background/
[CSS3TEXT]
Elika Etemad; Koji Ishii. CSS Text Module Level 3. URL: https://www.w3.org/TR/css-text-3/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119

Property Index

Name Value Initial Applies to Inh. %ages Media Anim­ation type Canonical order Com­puted value
block-size <‘width’> auto Same as width and height No As for the corresponding physical property visual discrete per grammar Same as width and height
inline-size <‘width’> auto Same as width and height No As for the corresponding physical property visual discrete per grammar Same as width and height
min-block-size <‘min-width’> 0 same as width and height No As for the corresponding physical property visual discrete per grammar Same as min-width and min-height
min-inline-size <‘min-width’> 0 same as width and height No As for the corresponding physical property visual discrete per grammar Same as min-width and min-height
max-block-size <‘max-width’> none same as width and height no As for the corresponding physical property visual discrete per grammar Same as max-width and max-height
max-inline-size <‘max-width’> none same as width and height no As for the corresponding physical property visual discrete per grammar Same as max-width and max-height
margin-block-start <‘margin-left’> 0 Same as margin no As for the corresponding physical property visual discrete per grammar the percentage as specified or the absolute length or auto (see text)
margin-block-end <‘margin-left’> 0 Same as margin no As for the corresponding physical property visual discrete per grammar the percentage as specified or the absolute length or auto (see text)
margin-inline-start <‘margin-left’> 0 Same as margin no As for the corresponding physical property visual discrete per grammar the percentage as specified or the absolute length or auto (see text)
margin-inline-end <‘margin-left’> 0 Same as margin no As for the corresponding physical property visual discrete per grammar the percentage as specified or the absolute length or auto (see text)
margin-block <‘margin-left’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
margin-inline <‘margin-left’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
inset-block-start <‘top’> auto positioned elements no As for the corresponding physical property visual discrete per grammar Same as box offsets: top, right, bottom, left properties except that directions are flow-relative
inset-block-end <‘top’> auto positioned elements no As for the corresponding physical property visual discrete per grammar Same as box offsets: top, right, bottom, left properties except that directions are flow-relative
inset-inline-start <‘top’> auto positioned elements no As for the corresponding physical property visual discrete per grammar Same as box offsets: top, right, bottom, left properties except that directions are flow-relative
inset-inline-end <‘top’> auto positioned elements no As for the corresponding physical property visual discrete per grammar Same as box offsets: top, right, bottom, left properties except that directions are flow-relative
inset-block <‘top’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
inset-inline <‘top’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
inset <‘top’>{1,4} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
padding-block-start <‘padding-left’> 0 all elements no As for the corresponding physical property visual discrete per grammar length (see text)
padding-block-end <‘padding-left’> 0 all elements no As for the corresponding physical property visual discrete per grammar length (see text)
padding-inline-start <‘padding-left’> 0 all elements no As for the corresponding physical property visual discrete per grammar length (see text)
padding-inline-end <‘padding-left’> 0 all elements no As for the corresponding physical property visual discrete per grammar length (see text)
padding-block <‘padding-left’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
padding-inline <‘padding-left’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block-start-width <‘border-top-width’> medium all elements no n/a visual discrete per grammar absolute length; 0 if the border style is none or hidden (see text)
border-block-end-width <‘border-top-width’> medium all elements no n/a visual discrete per grammar absolute length; 0 if the border style is none or hidden (see text)
border-inline-start-width <‘border-top-width’> medium all elements no n/a visual discrete per grammar absolute length; 0 if the border style is none or hidden (see text)
border-inline-end-width <‘border-top-width’> medium all elements no n/a visual discrete per grammar absolute length; 0 if the border style is none or hidden (see text)
border-block-width <‘border-top-width’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline-width <‘border-top-width’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block-start-style <‘border-top-style’> none all elements no n/a visual discrete per grammar specified value (see text)
border-block-end-style <‘border-top-style’> none all elements no n/a visual discrete per grammar specified value (see text)
border-inline-start-style <‘border-top-style’> none all elements no n/a visual discrete per grammar specified value (see text)
border-inline-end-style <‘border-top-style’> none all elements no n/a visual discrete per grammar specified value (see text)
border-block-style <‘border-top-style’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline-style <‘border-top-style’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block-start-color color currentcolor all elements no n/a visual discrete per grammar computed color (see text)
border-block-end-color color currentcolor all elements no n/a visual discrete per grammar computed color (see text)
border-inline-start-color color currentcolor all elements no n/a visual discrete per grammar computed color (see text)
border-inline-end-color color currentcolor all elements no n/a visual discrete per grammar computed color (see text)
border-block-color <‘border-top-color’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline-color <‘border-top-color’>{1,2} see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block-start <‘border-top-width’> || <‘border-top-style’> || <color> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block-end <‘border-top-width’> || <‘border-top-style’> || <color> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline-start <‘border-top-width’> || <‘border-top-style’> || <color> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline-end <‘border-top-width’> || <‘border-top-style’> || <color> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-block <‘border-block-start’> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
border-inline <‘border-block-start’> see individual properties see individual properties see individual properties see individual properties see individual properties see individual properties per grammar see individual properties
background-image-transform logical | physical | rotate physical all elements yes n/a visual discrete per grammar as specified
border-image-transform logical | physical | rotate rotate All elements, except internal table elements when border-collapse is collapse yes n/a visual discrete per grammar as specified

Issues Index

Things That Are Unstable Since implementation of parts of this module is effectively required for shipping an implementation of CSS Writing Modes on the Web (in order to correctly implement the default HTML styles), The CSSWG resolved that although the draft is not very stable overall, the requisite features in §1 Flow-Relative Values: block-start, block-end, inline-start, inline-end and §3 Flow-Relative Box Model Properties are approved for shipping. However, there are a number of unstable features in this draft (which are not required for implementing the HTML default style sheet, incidentally), and these are: Comments and suggestions are welcome on these issues. Please file them in GitHub, tweet them to @csswg, or send them to www-style@w3.org.
Depending on the element’s own writing mode simplifies the cascading calculations and gives a straightforward model for authors to reason about. However, it is problematic in many cases, see for example this discussiona.
other candidates of the keyword are: relative, script, writing-mode, beas, or the value itself (e.g., vertical-lr-ltr)
is this the right default? we need to investigate which is more common
should also add repeat-horizontal and repeat-vertical for the physical value?
is this the right initial default?