Shortname: css-logical-props Level: 1 Status: ED Work Status: Exploring Group: csswg ED: https://drafts.csswg.org/css-logical-props/ Editor: Rossen Atanassov, Microsoft, ratan@microsoft.com Editor: Elika J. Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact 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 Link Defaults: css21 (property) width/height/min-width/min-height/max-width/max-height
Name: caption-side
New values: block-start | block-end | inline-start | inline-end
The 'caption-side' property is 1-dimensional in CSS2.1,
but was 2-dimensional in CSS2.0,
(and presumably will be 2-dimensional again in the next update to CSS tables).
It therefore accepts the full set of logical directions.
However, the ''inline-start'' and ''inline-end'' properties
(which correspond to the behavior of the ''caption-side/left'' and ''caption-side/right'' values in CSS2.0)
are only required to be supported by UAs that support ''caption-side/left'' and ''caption-side/right''.
Name: float, clear
New values: inline-start | inline-end
Issue: Is this a 2-directional property? Should these just be ''start''/''end''?
Name: text-align
New values: start | end
These values are normatively defined in [[!CSS3TEXT]].
float needs coordination with GCPM where it defines page floats
Name: resize
New values: block | inline
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 {
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'.
How do computed value APIs, e.g., getComputedStyle() work? Can they be used with either logical or physical properties, or only with the physical ones?
Name: block-size, inline-size Value: <<'width'>> Initial: auto Applies to: same as 'width' and 'height' Inherited: no Percentages: block-size/inline-size, respectively, of containing block Media: visual Computed value: same as 'width' and 'height'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: block-size/inline-size, respectively, of containing block Media: visual Computed value: same as 'min-width' and 'min-height'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: block-size/inline-size, respectively, of containing block Media: visual Computed value: same as 'max-width' and 'max-height'These properties correspond to the 'max-width' and 'max-height' properties. The mapping depends on the element's 'writing-mode'.
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: depends on layout model Media: visual Computed value: the percentage as specified or the absolute length or auto (see text)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: offset-block-start, offset-block-end, offset-inline-start, offset-inline-end Value: <<'left'>> Initial: auto Applies to: positioned elements Inherited: no Percentages: logical-width, resp. logical-height of containing block Media: visual Computed value: same as box offsets: 'top', 'right', 'bottom', 'left' properties except that directions are logicalThese properties correspond to the 'top', 'bottom', 'left', and 'right' properties. The mapping depends on the parent element's 'writing-mode', 'direction', and 'text-orientation'.
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: logical-width of containing block Media: visual Computed value: length (see text)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: border-block-start-width, border-block-end-width, border-inline-start-width, border-inline-end-width Value: border-width Initial: medium Applies to: all elements Inherited: no Percentages: logical-width of containing block Media: visual Computed value: absolute length; 0 if the border style is none or hidden (see text)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-start-style, border-block-end-style, border-inline-start-style, border-inline-end-style Value: border-style Initial: none Applies to: all elements Inherited: no Percentages: n/a Media: visual Computed value: specified value (see text)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-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)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-start, border-block-end, border-inline-start, border-inline-end Value: border-width || border-style || color Initial: (see individual properties) Applies to: all elements Inherited: no Percentages: see individual properties Media: visual Computed value: see individual propertiesThese 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'.
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 accept the ''margin/logical'' keyword:
<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 logical properties as follows:
Should the shorthand also reset the physical properties to their initial values?
blockquote {
margin: logical 1em 2em 3em 4em;
}
blockquote {
margin-block-start: 1em;
margin-inline-end: 2em;
margin-block-end: 3em;
margin-inline-start: 4em;
}
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
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 logical or physical. Values have the following meanings:
should also add repeat-horizontal and repeat-vertical for the physical value?
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
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: