Skip to content

Commit dfa7bc6

Browse files
committed
[css-snap-size] Misc edits, image updated
1 parent 37243ad commit dfa7bc6

2 files changed

Lines changed: 45 additions & 33 deletions

File tree

css-snap-size/Overview.bs

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ Values have the following meanings:
4343
<dl dfn-for="snap-height">
4444
<dt><<length>>
4545
<dd>
46-
This value defines the <dfn>grid unit</dfn>.
46+
This value defines the <dfn>snap unit</dfn>.
4747
Non-negative lengths are valid.
4848
<dt><<integer>>
4949
<dd>
50-
This value defines the <dfn>grid baseline position</dfn>
51-
within the <a>grid unit</a>.
50+
This value defines the <dfn>snap baseline position</dfn>
51+
within the <a>snap unit</a>.
5252
Values between 1 and 100 (inclusive) are valid.
5353
</dl>
5454

55-
When the <a>grid unit</a> is set to a positive length,
55+
When the <a>snap unit</a> is set to a positive length,
5656
the line box heights are rounded <i>up</i> to
5757
the closest multiple of the unit.
5858

@@ -61,13 +61,13 @@ defines how to compute the line box height
6161
after the line box was constructed from inline-level boxes.
6262
The rounding is applied to the computed line box height.
6363

64-
The <a>grid baseline position</a> then determines
64+
The <a>snap baseline position</a> then determines
6565
how the additional spaces are distributed to <a>over</a> and <a>under</a>.
6666
When it is not set,
6767
the space is distributed to <a>over</a> and <a>under</a> equally,
6868
so that the line box appears at the center of the
69-
multiple of <a>grid units</a>.
70-
When the <a>grid baseline position</a> is set,
69+
multiple of <a>snap units</a>.
70+
When the <a>snap baseline position</a> is set,
7171
refer to the <a href="#snap-baseline">snapping baselines</a> section below.
7272

7373
For block-level replaced elements,
@@ -87,7 +87,7 @@ by increasing the used value of 'margin-block-start' and 'margin-block-end' equa
8787
</div>
8888

8989
In the following example,
90-
the height of line box in each paragraph is rounded up to the <a>grid unit</a>.
90+
the height of line box in each paragraph is rounded up to the <a>snap unit</a>.
9191

9292
<pre class="lang-css">
9393
:root {
@@ -105,9 +105,9 @@ by increasing the used value of 'margin-block-start' and 'margin-block-end' equa
105105
}
106106
</pre>
107107

108-
The line box in &lt;h1&gt; does not fit into one <a>grid unit</a>
108+
The line box in &lt;h1&gt; does not fit into one <a>snap unit</a>
109109
and thus occupies two,
110-
but it is still centered within the two <a>grid unit</a>.
110+
but it is still centered within the two <a>snap unit</a>.
111111
</div>
112112

113113
Snapping Baselines {#snap-baseline}
@@ -118,22 +118,18 @@ Snapping Baselines {#snap-baseline}
118118
>
119119
</div>
120120

121-
When the <a>grid baseline position</a> is a positive value less than or equals to 100,
121+
When the <a>snap baseline position</a> is a positive value less than or equals to 100,
122122
the additional spaces are distributed using the following formula:
123123

124-
* space-over = BP - T % GU, add GU if negative
125-
* space-under = GU - (space-over + T + B) % GU
126-
* GU: the <a>grid unit</a>.
127-
* BP: the <a>grid baseline position</a> &times; GU / 100.
124+
* space-over = P - T % U, add U if negative
125+
* space-under = U - (space-over + T + B) % U
126+
* U: the <a>snap unit</a>.
127+
* P: the <a>snap baseline position</a> &times; U / 100.
128128
* T: the distance between the top of the line box and the baseline.
129129
* B: the distance between the bottom of the line box and the baseline.
130130

131-
<div class="issue">
132-
The formula needs verifications.
133-
</div>
134-
135131
This formula pushes the baseline of the line box
136-
down to the closest <a>grid baseline position</a>
132+
down to the closest <a>snap baseline position</a>
137133
as a consequence.
138134

139135
<div class="example">
@@ -142,8 +138,8 @@ as a consequence.
142138
>
143139
</div>
144140

145-
The following CSS sets the <a>grid baseline position</a>
146-
to 16pt (20pt &times; 0.70) from the top.
141+
The following CSS sets the <a>snap baseline position</a>
142+
to 14pt (20pt &times; 0.70) from the top.
147143

148144
<pre class="lang-css">
149145
:root {
@@ -153,12 +149,12 @@ as a consequence.
153149
</pre>
154150

155151
The baseline of the line box is pushed down
156-
to the closest <a>grid baseline position</a>
152+
to the closest <a>snap baseline position</a>
157153
by adding the space-over.
158154

159155
&lt;h1&gt; is as tall as
160-
its baseline is lower than the second <a>grid baseline position</a>
161-
that it is pushed down to the third <a>grid baseline position</a>.
156+
its baseline is lower than the second <a>snap baseline position</a>
157+
that it is pushed down to the third <a>snap baseline position</a>.
162158
</div>
163159

164160
Snapping Block Boxes {#snap-block-height}
@@ -171,23 +167,22 @@ Snapping Widths: the 'snap-width' property {#snap-width}
171167

172168
<pre class='propdef'>
173169
Name: snap-width
174-
Value: none | <<length>>
175-
Initial: none
170+
Value: <<length>>
171+
Initial: 0px
176172
Applies to: block, flex and grid containers
177173
Inherited: yes
178174
Animatable: no
179175
Percentages: N/A
180176
Media: visual
181-
Computed Value: length becomes the absolute length, others as specified
177+
Computed Value: the absolute length
182178
</pre>
183179
Values have the following meanings:
184180

185181
<dl dfn-for="snap-width">
186-
<dt><dfn>none</dfn>
187-
<dd>
188-
This value indicates that there is no snapping behavior.
189182
<dt><<length>>
190183
<dd>
184+
Non-negative lengths are valid.
185+
191186
When this property is set to a positive <<length>>,
192187
the logical width of the content-box is rounded <i>down</i>
193188
to the closest multiple of the <<length>>

css-snap-size/images/line-grid-baseline.svg

Lines changed: 19 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)