You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[css-borders-4] [css-shapes-1] Specify rendering of single-path border-shape (#12897)
* [css-borders-4] [css-shapes-1] Specify rendering of single-path border-shape
border-shape takes its color (and thickness if single-path) from one of the
border sides, namely the first one (in logical order) that has a border-style
other than none.
Also define half-border-box as per resolution, in css-shapes-1.
#11662 (comment)Closes#11662
* Update css-borders-4/Overview.bs
Co-authored-by: Tab Atkins Jr. <[email protected]>
---------
Co-authored-by: Tab Atkins Jr. <[email protected]>
Copy file name to clipboardExpand all lines: css-borders-4/Overview.bs
+23-9Lines changed: 23 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -3048,23 +3048,33 @@ The 'border-shape' property</h3>
3048
3048
Initial: none
3049
3049
Applies to: all elements
3050
3050
Inherited: no
3051
-
Percentages: relative to the given <<geometry-box>>, or to [=border box=] if not given.
3051
+
Percentages: see prose
3052
3052
Computed value: list, each item a computed color
3053
3053
Animation type: by computed value
3054
3054
</pre>
3055
3055
3056
3056
The 'border-shape' property is provided with either a single <<basic-shape>> or two <<basic-shape>>s,
3057
3057
resulting in one or two paths, respectively.
3058
-
The single-path border shape varint uses the existing ''border'' properties of the element to stroke the
3059
-
path that the given <<basic-shape>> resolves to,
3060
-
while the double-path border shape variant fills the area between the two paths as if it were the border.
3058
+
3059
+
When two <<basic-shape>> values are given, the border is rendered between the paths generated shapes.
3060
+
When only a single <<basic-shape>> is given, the border is rendered as a stroke with the
3061
+
[=relevant side for border shape|relevant side=]'s [=computed value|computed=][=border width=] as the stroke width.
3062
+
3063
+
The fill color of the border is the [=relevant side for border shape|relevant side=]'s [=computed value|computed=]'border-color'.
3064
+
3065
+
When a <<geometry-box>> is not given, the default computation of percentage differs based on the number of given <<basic-shape>> values.
3066
+
3067
+
When two <<basic-shape>> values are given, the first (outer) one defaults to the [=border box=] and the second (inner) one defaults to the [=padding box=].
3068
+
This allows using the different 'border-width' properties to affect the final shape.
3069
+
3070
+
When a single <<basic-shape>> value is given, the <<geometry-box>> defaults to the ''half-border-box'' value, which allows stroking in a way that matches the default border behavior.
3061
3071
3062
3072
The 'border-shape' property is not compatible with 'border-radius' and 'corner-shape'.
3063
3073
When an element's [=computed value=] of 'border-shape' is not <css>none</css>,
3064
3074
its 'border-radius' is ignored, as if it was set to 0.
3065
3075
'corner-shape' is implicitly ignored, as it can only work in tandem with 'border-radius'.
3066
3076
3067
-
A 'box-shadow' follows both the inner and outer border paths.
3077
+
A 'box-shadow' follows both the outer border path.
3068
3078
3069
3079
'border-shape' does not affect geometry or layout,
3070
3080
which is still computed using the existing 'border-width' properties.
@@ -3077,11 +3087,15 @@ as described in <a href="https://drafts.csswg.org/css-backgrounds-3/#corner-clip
3077
3087
3078
3088
Issue: how should this affect clipping replaced elements?
3079
3089
3080
-
The fill and stroke color, as well as the stroke width, are taken from the respective 'border-color' and 'border-width' properties.
3081
-
3082
-
Issue: define this in detail. Perhaps it should be overridable somehow?
An element's <dfn>relevant side for border shape</dfn> is the first side (in the order [=block-start=], [=inline-start=], [=block-end=], and [=inline-end]) that has a non-''border-style/none'' [=border style=], or [=block-start=] if they're all ''border-style/none''.
3092
+
1. If |element|'s [=computed value|computed=] 'border-block-start-style' is not ''border-style/none'', then return [=block-start=].
3093
+
1. If |element|'s [=computed value|computed=] 'border-inline-start-style' is not ''border-style/none'', then return [=inline-start=].
3094
+
1. If |element|'s [=computed value|computed=] 'border-block-end-style' is not ''border-style/none'', then return [=block-end=].
3095
+
1. If |element|'s [=computed value|computed=] 'border-inline-end-style' is not ''border-style/none'', then return [=inline-end=].
3096
+
1. Return [=block-start=].
3097
+
</div>
3083
3098
3084
-
Issue: what do we do about 'border-style'? It can't exactly work for every arbitrary shape.
0 commit comments