Skip to content

Commit 63fc7d8

Browse files
committed
Merge branch 'master' of https://github.com/w3c/csswg-drafts
2 parents 1308291 + fdc1619 commit 63fc7d8

File tree

4 files changed

+90
-46
lines changed

4 files changed

+90
-46
lines changed

css-fonts-4/Overview.bs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ Relative sizing: the 'font-size-adjust' property</h3>
10121012
The value of 'font-size-adjust' affects the used value of 'font-size'
10131013
but does not affect the computed value.
10141014
It affects the size of relative units
1015-
that are based on font metrics of the <a>first available font</a>
1015+
that are based on font metrics
10161016
such as <code>ex</code> and <code>ch</code>
10171017
but does not affect the size of <code>em</code> units.
10181018
Since numeric values of 'line-height'
@@ -3175,7 +3175,7 @@ to ensure that the results are as consistent as possible across user agents,
31753175
given an identical set of available fonts and rendering technology.
31763176

31773177
The <dfn export>first available font</dfn>,
3178-
used for example in the definition of <a>font-relative lengths</a> such as ''ex'' and ''ch''
3178+
used for example in the definition of <a>font-relative lengths</a> such as ''ex''
31793179
or in the definition of the 'line-height' property
31803180
is defined to be the first available font
31813181
that would match the U+0020 (space) character
@@ -5101,4 +5101,4 @@ Changes from the <a href="https://www.w3.org/TR/2018/WD-css-fonts-4-20180410/">1
51015101
<li>Consistently use the new generic font families</li>
51025102
<li>Editorial cleanup, clarifying examples, markup improvements, linkfixes,
51035103
updating to latest references, and so on</li>
5104-
</ul>
5104+
</ul>

css-images-4/Overview.bs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ Conic Gradients: the ''conic-gradient()'' notation</h3>
11071107
<div style="overflow: hidden">
11081108
<img style="float: right; margin-left: 1em;" src='images/conic-diagram.png' alt="[An image showing a box with a background shading gradually clockwise from white to black, starting from the top. A gradient circle is shown, and the colors at 0 and 216 degrees respectively.]">
11091109

1110-
This example visually illustrates how ''conic-gradient(at 25% 30%, white, black 60%)'' would be drawn. Note that since color stop positions always resolve to angles, the only effect of the center center is a 2D translation of the gradient, i.e. it does not affect how the gradient is drawn.
1110+
This example visually illustrates how ''conic-gradient(at 25% 30%, white, black 60%)'' would be drawn. Note that since color stop positions always resolve to angles, the only effect of the ''at 25% 30%'' is a 2D translation of the gradient, i.e. it does not affect how the gradient is drawn.
11111111
</div>
11121112
</div>
11131113

@@ -1134,7 +1134,7 @@ Conic Gradients: the ''conic-gradient()'' notation</h3>
11341134

11351135
<dt><dfn><<position>></dfn>
11361136
<dd>
1137-
Determines the <dfn dfn>gradient center</dfn> of the gradient.
1137+
Determines the <dfn dfn export>gradient center</dfn> of the gradient.
11381138
The <<position>> value type (which is also used for 'background-position')
11391139
is defined in [[css-values-3]],
11401140
and is resolved using the center-point as the object area
@@ -1154,7 +1154,7 @@ Conic Gradients: the ''conic-gradient()'' notation</h3>
11541154
<h4 id='conic-color-stops' class='no-toc'>
11551155
Placing Color Stops</h4>
11561156

1157-
Color stops are placed on a <a>gradient line</a> that curves around the center in a circle,
1157+
Color stops are placed on a <a>gradient line</a> that curves around the <a>gradient center</a> in a circle,
11581158
with both the 0% and 100% locations at 0deg.
11591159
Just like linear gradients,
11601160
0deg points to the top of the page,
@@ -1215,7 +1215,7 @@ Conic Gradient Examples</h4>
12151215

12161216
<pre class=lang-css>
12171217
background: conic-gradient(from 45deg, white, black, white);
1218-
background: conic-gradient(hsl(0,0%,87.5%), white 45deg, black 225deg, hsl(0,0%,87.5%));
1218+
background: conic-gradient(hsl(0,0%,75%), white 45deg, black 225deg, hsl(0,0%,75%));
12191219
</pre>
12201220

12211221
<img src="images/conic3.png" alt="" >
@@ -1908,8 +1908,8 @@ Interpolating <<image>> {#interpolating-images}
19081908
(like some gradients)
19091909
have their own special interpolation rules.
19101910
In general terms,
1911-
images are interpolated by scaling them to the size of the start image
1912-
and cross-fading the two while they transition to the size of the end image.
1911+
images are interpolated by scaling them to the size of the <var>start image</var>
1912+
and cross-fading the two while they transition to the size of the <var>end image</var>.
19131913

19141914
In specific terms,
19151915
at each point in the interpolation
@@ -1986,7 +1986,7 @@ Interpolating <<gradient>> {#interpolating-gradients}
19861986

19871987
* Otherwise, the size must be changed to a pair of <<length>>s
19881988
that would produce an equivalent ending-shape.
1989-
If the <<ending-shape>> was specified as ''circle'',
1989+
If the <<ending-shape>> was specified as <a value spec=css-images-3>circle</a>,
19901990
change it to ''ellipse''.
19911991

19921992
2. Interpolate each component and color-stop of the gradients independently.

css-shadow-parts-1/Overview.bs

+18-8
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ as authors can use ''::part()'' without fear of accidental over-styling.
121121
Exposing a Shadow Element: {#exposing}
122122
=============================================================
123123
Elements in a <a>shadow tree</a> may be exposed for styling by stylesheets outside the tree
124-
using the part and partmap attributes.
124+
using the part and exposedparts attributes.
125125

126126
Each element has a <dfn export for="element">part name list</dfn>
127127
which is an [=ordered set=] of tokens.
@@ -133,8 +133,6 @@ with keys that are [=strings=]
133133
and values that are [=ordered sets=] of [=strings=]
134134
(part names that are selectable inside this element).
135135

136-
Issue(w3c/csswg-drafts#2414): Document how the part name map will be exposed via IDL.
137-
138136
Each <a>shadow root</a> can be thought of as having a <dfn export for="shadow root">part element map</dfn>
139137
with keys that are [=strings=]
140138
and values that are [=ordered sets=] of elements.
@@ -199,16 +197,16 @@ not an id or tagname.
199197
&lt;/script&gt;
200198
</pre>
201199

202-
Forwarding a Shadow Element: the <{html-global/partmap}> attribute {#partmap-attr}
200+
Forwarding a Shadow Element: the <{html-global/exposedparts}> attribute {#exposedparts-attr}
203201
----------------------------------------------------------------------------------
204-
Any element in a shadow tree can have a <dfn element-attr for=html-global>partmap</dfn> attribute.
202+
Any element in a shadow tree can have a <dfn element-attr for=html-global>exposedparts</dfn> attribute.
205203
If the element is a shadow host,
206204
this is used to allow styling of parts from hosts inside the <a>shadow tree</a>
207205
by rules outside this the <a>shadow tree</a>
208206
(as if they were elements in the same tree as the host,
209207
named by a part attribute).
210208

211-
The partmap attribute is parsed as a comma-separated list of part mappings.
209+
The exposedparts attribute is parsed as a comma-separated list of part mappings.
212210
Each part mapping is one of:
213211

214212
<dl class=switch>
@@ -233,7 +231,7 @@ Issue(w3c/csswg-drafts#2411): Decide whether to allow "ident1 => ident2 ident3 .
233231
as shorthand for "ident1 ident2, ident1 ident3, ...".
234232

235233
Issue(w3c/csswg-drafts#2411): Decide whether to allow wild-card forwarding,
236-
e.g partmap="button-* buttons".
234+
e.g exposedparts="button-* buttons".
237235
Consider excluding sub-parts that have been explicitly forwarded.
238236
Consider a mechanism to exclude sub-parts without forwarding them.
239237

@@ -243,7 +241,7 @@ Consider a mechanism to exclude sub-parts without forwarding them.
243241
&lt;/style&gt;
244242

245243
&lt;template id="c-e-outer-template"&gt;
246-
&lt;c-e-inner <b>partmap="innerspan textspan"</b>&gt;&lt;/c-e-inner&gt;
244+
&lt;c-e-inner <b>exposedparts="innerspan textspan"</b>&gt;&lt;/c-e-inner&gt;
247245
&lt;/template&gt;
248246

249247
&lt;template id="c-e-inner-template"&gt;
@@ -366,3 +364,15 @@ but never match additional <a>shadow-part pseudo-elements</a>.
366364
would select just the one button's label,
367365
ignoring any other labels.
368366
</div>
367+
368+
Extensions to the {{Element}} Interface {#idl}
369+
==============================================
370+
371+
We expose the `part` and `exposedparts` attributes as read/write string properties on Element.
372+
373+
<pre class=idl>
374+
partial interface Element {
375+
attribute DOMString part;
376+
attribute DOMString exposedParts;
377+
};
378+
</pre>

css-values-4/Overview.bs

+62-28
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ spec: css-backgrounds-3; type: type; text: <position>
2020
spec: css2; type: property; text: border-collapse
2121
spec: css-color-4; type: value; text: currentcolor
2222
spec: css-cascade-4; type: at-rule; text: @import
23+
spec: css-sizing-3; type: property;
24+
text: min-width
25+
text: box-sizing
2326
</pre>
2427
<style>
2528
code, small { white-space: nowrap }
@@ -1633,59 +1636,90 @@ Mathematical Expressions: ''calc()'', ''min()'', ''max()'', and ''clamp()''</h3>
16331636
that evaluate to a valid argument type (like <<length>>).
16341637

16351638
<div class="example">
1636-
<pre>
1639+
1640+
[=Math functions=] can be used to combine value that use different units.
1641+
In this example the author wants the <em>margin box</em> of each section
1642+
to take up 1/3 of the space,
1643+
so they start with <css>100%/3</css>,
1644+
then subtract the element's borders and margins.
1645+
('box-sizing' can automatically achieve this effect for borders and padding,
1646+
but a [=math function=] is needed if you want to include margins.)
1647+
1648+
<pre class=lang-css>
16371649
section {
16381650
float: left;
16391651
margin: 1em; border: solid 1px;
16401652
width: calc(100%/3 - 2*1em - 2*1px);
16411653
}
16421654
</pre>
1643-
</div>
16441655

1645-
<div class="example">
1646-
<pre>
1647-
p {
1648-
margin: calc(1rem - 2px) calc(1rem - 1px);
1656+
Similarly, in this example the gradient will show a color transition
1657+
only in the first and last ''20px'' of the element:
1658+
1659+
<pre class=lang-css>
1660+
.fade {
1661+
background-image: linear-gradient(silver 0%, white 20px,
1662+
white calc(100% - 20px), silver 100%);
16491663
}
16501664
</pre>
16511665
</div>
16521666

16531667
<div class="example">
1654-
The following sets the 'font-size' so that exactly 40em fits within the viewport,
1668+
1669+
[=Math functions=] can also be useful just to express values
1670+
in a more natural, readable fashion,
1671+
rather than as an obscure decimal.
1672+
For example, the following sets the 'font-size' so that exactly 35em fits within the viewport,
16551673
ensuring that roughly the same amount of text always fills the screen no matter the screen size.
16561674

1657-
<pre>
1675+
<pre class=lang-css>
16581676
:root {
1659-
font-size: calc(100vw / 40);
1677+
font-size: calc(100vw / 35);
16601678
}
16611679
</pre>
16621680

1663-
If the rest of the design is specified using the ''rem'' unit,
1664-
the entire layout will scale to match the viewport width.
1681+
Functionality-wise, this is identical to just writing ''font-size: 2.857vw'',
1682+
but then the intent
1683+
(that ''35em'' fills the viewport)
1684+
is much less clear to someone reading the code;
1685+
the later reader will have to reverse the math themselves
1686+
to figure out that 2.857 is meant to approximate 100/35.
16651687
</div>
16661688

1667-
<div class='example'>
1668-
The following example stacks two centered background images,
1669-
with one offset slightly from the other.
1689+
<div class="example">
16701690

1671-
<pre>
1672-
.foo {
1673-
background: url(top.png), url(bottom.png);
1674-
background-repeat: no-repeat;
1675-
background-position: calc(50% + 20px) calc(50% + 20px), 50% 50%;
1691+
''min()'', ''max()'', and ''clamp()'' can be used to make sure a value doesn't exceed a "safe" limit:
1692+
For example, "responsive type" that sets 'font-size' with viewport units
1693+
might still want a minimum size to ensure readability:
1694+
1695+
<pre class=lang-css>
1696+
.type {
1697+
/* Set font-size to 10x the average of vw and vh,
1698+
but don't let it go below 12px. */
1699+
font-size: max(10 * (1vw + 1vh) / 2, 12px);
16761700
}
16771701
</pre>
1678-
</div>
16791702

1680-
<div class='example'>
1681-
This example shows how to place color-stops on a gradient an equal distance from either end.
1703+
Note: Full math expressions are allowed in each of the arguments;
1704+
there's no need to nest a ''calc()'' inside!
1705+
You can also provide more than two arguments,
1706+
if you have multiple constraints to apply.
1707+
</div>
16821708

1683-
<pre>
1684-
.foo {
1685-
background-image: linear-gradient(to right, silver,
1686-
white 50px,
1687-
white calc(100% - 50px),
1688-
silver);
1709+
<div class="example">
1710+
An occasional point of confusion when using ''min()''/''max()''
1711+
is that you use ''max()'' to impose a minimum value on something
1712+
(that is, properties like 'min-width' effectively use ''max()''),
1713+
and ''min()'' to impose a maximum value on something;
1714+
it's easy to accidentally reach for the opposite function
1715+
and try to use ''min()'' to add a minimum size.
1716+
Using ''clamp()'' can make the code read more naturally,
1717+
as the value is nestled between its minimum and maximum:
1718+
1719+
<pre class=lang-css>
1720+
.type {
1721+
/* Force the font-size to stay between 12px and 100px */
1722+
font-size: clamp(12px, 10 * (1vw + 1vh) / 2, 100px);
16891723
}
16901724
</pre>
16911725
</div>

0 commit comments

Comments
 (0)