Skip to content

Commit 584704e

Browse files
authored
[css-borders-4] Initial (somewhat scaffoldy) spec for 'border-shape' (#11656)
* [css-borders-4] Initial (somewhat scaffoldy) spec for 'border-shape' Closes #6997 This defines the 'border-shape' property with a narrow set of details that we've resolved on, leaving room for discussing some details as we go along. Specifically, this adds the two variants of 'border-shape' (single/double <basic-shape>). Issues to be opened separately: * interaction with border-{width|color|style} * Clipping replaced elements * Lots of examples * Expand a bit about overflow
1 parent 5366312 commit 584704e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

css-borders-4/Overview.bs

+54
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Warning: Not Ready
1919
<pre class="link-defaults">
2020
spec:css-text-4; type:value; text:collapse
2121
spec:css-shapes-2; type:function; text:path()
22+
spec:css-shapes-2; type:property; text:shape-inside
2223
</pre>
2324

2425
<link rel="stylesheet" href="style.css" />
@@ -1087,6 +1088,59 @@ Layering, Layout, and Other Details</h4>
10871088
or an inner shadow on a rowspanning table cell that adjoins cells with different border thicknesses),
10881089
the exact position and rendering of its shadows are undefined.
10891090

1091+
<h2 id="border-shape">
1092+
Border Shaping</h2>
1093+
1094+
While 'corner-shape' and 'border-radius' allow some expressiveness to styling a border,
1095+
they still work with the assumption that the border is rectangular.
1096+
1097+
The 'border-shape' function augments these capabilities,
1098+
by enabling the author to use any [=basic shape=] to specify the path of the border.
1099+
1100+
<h3 id="border-shape-func">
1101+
The 'border-shape' property</h3>
1102+
1103+
<pre class="propdef">
1104+
Name: border-shape
1105+
Value: none | [ <<basic-shape>> <<geometry-box>>?]{1,2}
1106+
Initial: none
1107+
Applies to: all elements
1108+
Inherited: no
1109+
Percentages: relative to the given <<geometry-box>>, or to [=border box=] if not given.
1110+
Computed value: list, each item a computed color
1111+
Animation type: by computed value
1112+
</pre>
1113+
1114+
The 'border-shape' property is provided with either a single <<basic-shape>> or two <<basic-shape>>s,
1115+
resulting in one or two paths, respectively.
1116+
The single-path border shape varint uses the existing ''border'' properties of the element to stroke the
1117+
path that the given <<basic-shape>> resolves to,
1118+
while the double-path border shape variant fills the area between the two paths as if it were the border.
1119+
1120+
The 'border-shape' property is not compatible with 'border-radius' and 'corner-shape'.
1121+
When an element's [=computed value=] of 'border-shape' is not <css>none</css>,
1122+
its 'border-radius' is ignored, as if it was set to 0.
1123+
'corner-shape' is implicitly ignored, as it can only work in tandem with 'border-radius'.
1124+
1125+
A 'box-shadow' follows both the inner and outer border paths.
1126+
1127+
'border-shape' does not affect geometry or layout,
1128+
which is still computed using the existing 'border-width' properties.
1129+
1130+
'border-shape' does not affect the flow of content inside the box.
1131+
Note: An author can use 'border-shape' in tandem with 'shape-inside' to create effects that decorate the box and control its text flow at the same time.
1132+
1133+
The inner 'border-shape' clips the [=overflow=] content of the element, in the same manner as 'border-radius',
1134+
as described in <a href="https://drafts.csswg.org/css-backgrounds-3/#corner-clipping">corner clipping</a>.
1135+
1136+
Issue: how should this affect clipping replaced elements?
1137+
1138+
The fill and stroke color, as well as the stroke width, are taken from the respective 'border-color' and 'border-width' properties.
1139+
1140+
Issue: define this in detail. Perhaps it should be overridable somehow?
1141+
1142+
Issue: what do we do about 'border-style'? It can't exactly work for every arbitrary shape.
1143+
10901144
<h2 id="changes">
10911145
Changes</h2>
10921146

0 commit comments

Comments
 (0)