From 8463087f9c6e613ca2355aff8261fb6fc5d5f0e3 Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
- Should logical border properties be moved from
- CSS Logical
- to here?
+ The proposed syntax for this feature is under discussion
+ 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 [[!CSS2]] border shorthand properties
+ accept the ''margin/logical'' keyword:
+ The border can either be a predefined style (solid line, double
+ line, dotted line, pseudo-3D border, etc.) or it can be an image. In
+ the former case, various properties define the style ('border-style'),
+ color ('border-color'), and thickness ('border-width') of the border.
-
- The proposed syntax for this feature is under discussion
- 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 [[!CSS2]] border shorthand properties
- accept the ''margin/logical'' keyword:
-
Borders
+
+ Logical Borders
+
+
+ Logical 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: Same as 'border-top-width'
+ Inherited: no
+ Logical property group: border-width
+ Percentages: n/a
+ Computed value: Same as corresponding 'border-*-width' properties
+ Animation type: by computed value type
+
+
+ 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}
+
+
+ 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.
+
+
+ Logical 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: Same as 'border-top-style'
+ Inherited: no
+ Logical property group: border-style
+ Percentages: n/a
+ Computed value: Same as corresponding 'border-*-style' properties
+ 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}
+
+
+ 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.
+
+
+ Logical 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: <<'border-top-color'>>
+ Initial: currentcolor
+ Applies to: Same as 'border-top-color'
+ Inherited: no
+ Logical property group: border-color
+ Percentages: n/a
+ Computed value: Same as corresponding 'border-*-color' properties
+ Animation type: by computed value type
+
+
+ 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}
+
+
+ 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 color,
+ and the second value represents the end edge color.
+ If only one value is given, it applies to both the start and end edges.
+
+
+ Logical 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'>> || <
+
+ 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'>>
+
+
+ These two shorthand properties set the
+ 'border-block-start' & 'border-block-end'
+ or
+ 'border-inline-start' & 'border-inline-end',
+ respectively,
+ both to the same style.
+
+
+
+
+Four-Directional Shorthand Properties: the 'border-width', 'border-style', and 'border-color' shorthands
+
+ The shorthand properties for borders
+ 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 Logical properties instead of the physical ones.
+
+
+
+ The syntax for these properties is effectively changed by replacing
+ <value-type>{1,4}
+
+ with
+ logical? <value-type>{1,4}
+
+ When the ''margin/logical'' keyword is present in the value,
+ the values that follow are assigned to its Logical longhands
+ as follows:
+
+
+
+
+
+ blockquote {
+ border: logical 1em 2em 3em 4em;
+ }
+ blockquote {
+ border-block-start: 1em;
+ border-inline-start: 2em;
+ border-block-end: 3em;
+ border-inline-end: 4em;
+ }
+
+
Line Colors: the 'border-color' properties
@@ -99,6 +292,29 @@ Line Colors: the 'border-color' properties
Corners
+
+Logical Corner Rounding:
+the 'border-start-start-radius', 'border-start-end-radius', 'border-end-start-radius', 'border-end-end-radius' properties
+
+
+ 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: Same as 'border-top-left-radius'
+ Inherited: no
+ Logical property group: border-radius
+ Percentages: Same as 'border-top-left-radius'
+ Computed value: Same as corresponding physical 'border-*-radius' properties
+ Animation type: by computed value type
+
+
+ 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',
+ with the first start/end giving the block axis side,
+ and the second the inline-axis side
+ (i.e. patterned as 'border-block-inline-radius').
+
Corner Sizing: the 'border-radius' and 'border-*-radius' shorthand properties
@@ -817,6 +1033,8 @@ Additions since [[CSS3BG]]
* added 'corner-shape' and related 'corners' shorthand
* added partial borders via 'border-limit' and 'border-*-clip' properties
* turned 'box-shadow' into a shorthand and added longhands
+ * moved logical border properties from [[CSS-LOGICAL-1]] to this spec.
+ and called them "logical" instead of "flow-relative" like in other specs
Acknowledgments
From 773d2b54384a6a23efe290a357418c9ebfc7e173 Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
Borders
-
- Logical Borders
+
- Logical 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
+
+Line Colors: the 'border-color' properties
- 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: Same as 'border-top-width'
+ Name: border-top-color, border-right-color, border-bottom-color, border-left-color, border-block-start-color, border-block-end-color, border-inline-start-color, border-inline-end-color
+ Value: <
+
+
+ Name: border-color
+ Value: [ <
- 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'.
+ These properties set the foreground color of the border specified
+ by the 'border-style' properties.
+
+ The stripes defined by <
+ .foo {
+ border: 30px solid;
+ border-color: stripes(dodgerblue, skyblue) stripes(yellow, gold) stripes(lightgreen, limegreen) stripes(indianred, orange);
+ }
+
+
+ Sample rendering:
+
+
+
+ The same border colors with ''border-style: dotted'':
+
+
+
- Name: border-block-width, border-inline-width
- Value: <<'border-top-width'>>{1,2}
+ Name: border-block-color, border-inline-color
+ Value: <<'border-top-color'>>{1,2}
These two shorthand properties set the
- 'border-block-start-width' & 'border-block-end-width'
+ 'border-block-start-color' & 'border-block-end-color'
and
- 'border-inline-start-width' & 'border-inline-end-width',
+ 'border-inline-start-color' & 'border-inline-end-color',
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.
+ The first value represents the start edge color,
+ and the second value represents the end edge color.
+ If only one value is given,
+ it applies to both the start and end edges.
-
- Logical 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
+
+Line Patterns: the 'border-style' properties
- Name: border-block-start-style, border-block-end-style, border-inline-start-style, border-inline-end-style
- Value: <<'border-top-style'>>
+ Name: border-top-style, border-right-style, border-bottom-style, border-left-style, border-block-start-style, border-block-end-style, border-inline-start-style, border-inline-end-style
+ Value: <
- 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'.
+ The logical properties 'border-block-start-style', 'border-block-end-style',
+ 'border-inline-start-style', and 'border-inline-end-style' 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
@@ -105,54 +152,65 @@ Borders
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.
+ If only one value is given,
+ it applies to both the start and end edges.
-
- Logical 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
+
+Line Thickness: the 'border-width' properties
- 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: Same as 'border-top-color'
+ Name: border-top-width, border-right-width, border-bottom-width, border-left-width, border-block-start-width, border-block-end-width, border-inline-start-width, border-inline-end-width
+ Value: <
- 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'.
+ The logical properties 'border-block-start-width', 'border-block-end-width',
+ 'border-inline-start-width', and 'border-inline-end-width' 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-color, border-inline-color
- Value: <<'border-top-color'>>{1,2}
+ Name: border-block-width, border-inline-width
+ Value: <<'border-top-width'>>{1,2}
These two shorthand properties set the
- 'border-block-start-color' & 'border-block-end-color'
+ 'border-block-start-width' & 'border-block-end-width'
and
- 'border-inline-start-color' & 'border-inline-end-color',
+ 'border-inline-start-width' & 'border-inline-end-width',
respectively.
- The first value represents the start edge color,
- and the second value represents the end edge color.
- If only one value is given, it applies to both the start and end edges.
+ 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.
-
- Logical Border Shorthands:
- the 'border-block-start', 'border-block-end', 'border-inline-start', 'border-inline-end' properties and 'border-block' and 'border-inline' shorthands
+
+Border Shorthand Properties
- Name: border-block-start, border-block-end, border-inline-start, border-inline-end
- Value: <<'border-top-width'>> || <<'border-top-style'>> || <
- These properties correspond to the
+ The logical properties 'border-block-start', 'border-block-end',
+ 'border-inline-start', and 'border-inline-end' 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'.
+ The mapping depends on the element's 'writing-mode', 'direction',
+ and 'text-orientation'.
Name: border-block, border-inline
@@ -170,7 +228,7 @@ Borders
see discussion in https://github.com/w3c/csswg-drafts/issues/3519 -->
-
-Four-Directional Shorthand Properties: the 'border-width', 'border-style', and 'border-color' shorthands
+Four-Directional Shorthand Properties: the 'logical' keyword for 'border-width', 'border-style', and 'border-color'
The shorthand properties for borders
set values for physical properties by default.
@@ -234,89 +292,36 @@ Four-Directional Shorthand Properties: the 'border-width', 'border-style', and '
-Line Colors: the 'border-color' properties
-
-
- Name: border-top-color, border-right-color, border-bottom-color, border-left-color
- Value: <
-
-
- Name: border-color
- Value: [ <
-
- These properties set the foreground color of the border specified
- by the 'border-style' properties.
-
- The stripes defined by <
- .foo {
- border: 30px solid;
- border-color: stripes(dodgerblue, skyblue) stripes(yellow, gold) stripes(lightgreen, limegreen) stripes(indianred, orange);
- }
-
-
- Sample rendering:
-
-
-
- The same border colors with ''border-style: dotted'':
-
-
-
Corners
-
-Logical Corner Rounding:
-the 'border-start-start-radius', 'border-start-end-radius', 'border-end-start-radius', 'border-end-end-radius' properties
+
+Corner Sizing: the 'border-*-*-radius' properties
-
- 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: Same as 'border-top-left-radius'
+
+ Name: border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-start-start-radius, border-start-end-radius, border-end-start-radius, border-end-end-radius
+ Value: <
- 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',
+ The logical properties 'border-start-start-radius', 'border-start-end-radius',
+ 'border-end-start-radius', and 'border-end-end-radius' 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',
with the first start/end giving the block axis side,
and the second the inline-axis side
(i.e. patterned as 'border-block-inline-radius').
-Corner Sizing: the 'border-radius' and 'border-*-radius' shorthand properties
+Corner Sizing Shorthands: the 'border-radius' and 'border-*-radius' shorthand properties
Sizing The Corners Of One Side:
From 0f9dc00861c39a2555fd33e3594afe2b55ff0d43 Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
-Four-Directional Shorthand Properties: the 'logical' keyword for 'border-width', 'border-style', and 'border-color'
-
- The shorthand properties for borders
- 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 Logical properties instead of the physical ones.
-
-
-
-
- The syntax for these properties is effectively changed by replacing
- <value-type>{1,4}
-
- with
- logical? <value-type>{1,4}
-
- When the ''margin/logical'' keyword is present in the value,
- the values that follow are assigned to its Logical longhands
- as follows:
-
-
-
-
-
- blockquote {
- border: logical 1em 2em 3em 4em;
- }
- blockquote {
- border-block-start: 1em;
- border-inline-start: 2em;
- border-block-end: 3em;
- border-inline-end: 4em;
- }
-
-
Corners
From 55486e11a01748198d91a4a70eeae7ecdad06760 Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
Name: border-block-color, border-inline-color
@@ -133,12 +138,17 @@ Line Patterns: the 'border-style' properties
Animation type: discrete
- The logical properties 'border-block-start-style', 'border-block-end-style',
- 'border-inline-start-style', and 'border-inline-end-style' 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'.
+ The [=flow-relative=] properties
+ 'border-block-start-style',
+ 'border-block-end-style',
+ 'border-inline-start-style',
+ and 'border-inline-end-style'
+ correspond to the [=physical=] properties
+ 'border-top-style',
+ 'border-bottom-style',
+ 'border-left-style',
+ and 'border-right-style'.
+ The mapping depends on the element’s 'writing-mode', 'direction', and 'text-orientation'.
Name: border-block-style, border-inline-style
@@ -170,12 +180,17 @@ Line Thickness: the 'border-width' properties
Animation Type: by computed value
- The logical properties 'border-block-start-width', 'border-block-end-width',
- 'border-inline-start-width', and 'border-inline-end-width' 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'.
+ The [=flow-relative=] properties
+ 'border-block-start-width',
+ 'border-block-end-width',
+ 'border-inline-start-width',
+ and 'border-inline-end-width'
+ correspond to the [=physical=] properties
+ 'border-top-width',
+ 'border-bottom-width',
+ 'border-left-width',
+ and 'border-right-width'.
+ The mapping depends on the element’s 'writing-mode', 'direction', and 'text-orientation'.
Name: border-block-width, border-inline-width
@@ -206,11 +221,17 @@ Border Shorthand Properties
Animation Type: see individual properties
- The logical properties 'border-block-start', 'border-block-end',
- 'border-inline-start', and 'border-inline-end' 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'.
+ The [=flow-relative=] properties
+ 'border-block-start',
+ 'border-block-end',
+ 'border-inline-start',
+ and 'border-inline-end'
+ correspond to the [=physical=] properties
+ 'border-top',
+ 'border-bottom',
+ 'border-left',
+ and 'border-right'.
+ The mapping depends on the element’s 'writing-mode', 'direction', and 'text-orientation'.
Name: border-block, border-inline
@@ -245,12 +266,17 @@ Corner Sizing: the 'border-*-*-radius' properties
Animation Type: by computed value
- The logical properties 'border-start-start-radius', 'border-start-end-radius',
- 'border-end-start-radius', and 'border-end-end-radius' 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',
+ The [=flow-relative=] properties
+ 'border-start-start-radius',
+ 'border-start-end-radius',
+ 'border-end-start-radius',
+ and 'border-end-end-radius'
+ correspond to the [=physical=] properties
+ 'border-top-left-radius',
+ 'border-bottom-left-radius',
+ 'border-top-right-radius',
+ and 'border-bottom-right-radius'.
+ The mapping depends on the element’s 'writing-mode', 'direction', and 'text-orientation',
with the first start/end giving the block axis side,
and the second the inline-axis side
(i.e. patterned as 'border-block-inline-radius').
From 9d9a5335dc2d60da3afd2f711e391a00d10ccd68 Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
Line Patterns: the 'border-style' properties
@@ -160,10 +160,10 @@ Line Patterns: the 'border-style' properties
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.
+ The first value represents the start side style,
+ and the second value represents the end side style.
If only one value is given,
- it applies to both the start and end edges.
+ it applies to both the start and end sides.
Line Thickness: the 'border-width' properties
@@ -202,10 +202,10 @@ Line Thickness: the 'border-width' properties
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.
+ The first value represents the start side width,
+ and the second value represents the end side width.
If only one value is given,
- it applies to both the start and end edges.
+ it applies to both the start and end sides.
Border Shorthand Properties
From 84c2e482e8d987549d8d00fc46bb4a0c2bdaa6cc Mon Sep 17 00:00:00 2001
From: Sebastian Zartner
Acknowledgments