Skip to content

Commit 9c5cf03

Browse files
committed
[css-rhythm] Sketch out block-step-height feaure.
1 parent 3241994 commit 9c5cf03

File tree

1 file changed

+188
-2
lines changed

1 file changed

+188
-2
lines changed

css-rhythm/Overview.bs

Lines changed: 188 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Adjusting Line Box Heights: the 'line-height-step' property {#line-height-step}
7171
When the <a>step unit</a> is set to a positive <<length>>,
7272
the line box heights are rounded <i>up</i> to
7373
the closest multiple of the unit.
74-
Non-negative <<length>>s are valid.
74+
Negative <<length>> values are invalid.
7575

7676
[[!CSS21]] <a href="https://drafts.csswg.org/css2/visudet.html#line-height">&#xA7;10.8 Line height calculations</a>
7777
defines how to compute the height of a line box from its inline-level content.
@@ -150,7 +150,8 @@ Adjusting Line Box Heights: the 'line-height-step' property {#line-height-step}
150150
the use of 'vertical-align' or font fallback.
151151
</div>
152152

153-
Notes on Block-level Boxes {#block-height}
153+
<!--
154+
Notes on Block-level Boxes {#inline-block}
154155
------------------------------------------
155156

156157
<i>This section is not normative.</i>
@@ -180,6 +181,191 @@ Notes on Block-level Boxes {#block-height}
180181
to the multiple of ''18pt''.
181182
See <a href="examples/snap-height.html">a sample in action</a>.
182183
</div>
184+
-->
185+
186+
Adjusting Block-level Box Heights {#block-height}
187+
=================================
188+
189+
ISSUE: This proposal can be simplified down to just the 'block-step-size' property, represented solely through its shortened form as 'block-step'.
190+
This level will likely at most contain 'block-step-size' and 'block-step-insert', leaving 'block-step-align' and 'block-step-round' to be added if the future demands.
191+
The full design is described herein for current discussion and future reference.
192+
193+
ISSUE: This proposal is currently defined to apply only to block-level boxes. This limitation is solely to simplify the first iteration; it should eventually be extended to all layout modes that honor specified heights.
194+
195+
Specifying the Step Size: the 'block-step-size' property {#block-step-size}
196+
--------------------------------------------------------
197+
198+
<pre class="propdef">
199+
Name: block-step-size
200+
Value: none | <<length>>
201+
Initial: none
202+
Applies to: block-level boxes
203+
Inherited: no
204+
Animatable: ???
205+
Percentages: N/A
206+
Media: visual
207+
Computed Value: keyword or absolute length
208+
</pre>
209+
210+
This property defines the <a>step unit</a> for a block-level box’s <a>block size</a>.
211+
When the <a>step unit</a> is set to a positive <<length>>,
212+
the box’s outer height is rounded
213+
(see 'block-step-round')
214+
to the closest multiple of the unit.
215+
Negative <<length>> values are invalid.
216+
217+
Values other than ''block-step-size/none''
218+
cause the box to establish a new formatting context.
219+
220+
In situations where margins <a href="">collapse</a>,
221+
only the box’s own margin is considered
222+
in calculating its outer size.
223+
224+
Specifying the Spacing Type: the 'block-step-insert' property {#block-step-insert}
225+
--------------------------------------------------------
226+
227+
<pre class="propdef">
228+
Name: block-step-insert
229+
Value: margin | padding
230+
Initial: margin
231+
Applies to: block-level boxes
232+
Inherited: no
233+
Animatable: no
234+
Percentages: N/A
235+
Media: visual
236+
Computed Value: as specified
237+
</pre>
238+
239+
This property specifies whether extra spacing
240+
derived from applying 'block-step-size'
241+
is inserted inside (like 'padding') or outside (like 'margin')
242+
the box’s border.
243+
244+
Values have the following meanings:
245+
246+
<dl dfn-for="block-step-insert" dfn-type="value">
247+
<dt><dfn>margin</dfn>
248+
<dd>
249+
Any extra space resulting from a 'block-step-size'-induced adjustment
250+
is inserted outside the box’s border, as extra margin.
251+
252+
<dt><dfn>padding</dfn>
253+
<dd>
254+
Any extra space resulting from a 'block-step-size'-induced adjustment
255+
is inserted inside the box’s border, as extra padding.
256+
</dl>
257+
258+
Specifying Alignment: the 'block-step-align' property {#block-step-align}
259+
-----------------------------------------------------
260+
261+
<pre class="propdef">
262+
Name: block-step-align
263+
Value: auto | center | start | end
264+
Initial: auto
265+
Applies to: block-level boxes
266+
Inherited: no
267+
Animatable: no
268+
Percentages: N/A
269+
Media: visual
270+
Computed Value: as specified
271+
</pre>
272+
273+
This property specifies whether extra spacing
274+
derived from applying 'block-step-size'
275+
is inserted before, inserted after, or split between both sides of the box.
276+
277+
Values have the following meanings:
278+
279+
<dl dfn-for="block-step-align" dfn-type="value">
280+
<dt><dfn>auto</dfn>
281+
<dd>
282+
If 'block-step-insert' is ''margin'':
283+
if 'align-self' is ''start'', ''end'', or ''center'', treat as that value,
284+
otherwise treat as ''center''.
285+
286+
<dt><dfn>center</dfn>
287+
<dd>
288+
Any extra space resulting from a 'block-step-size'-induced adjustment
289+
is split, and applied half on either side of the box.
290+
<dt><dfn>start</dfn>
291+
<dd>
292+
Any extra space resulting from a 'block-step-size'-induced adjustment
293+
is inserted on the <a>start</a> side of the box.
294+
<dt><dfn>end</dfn>
295+
<dd>
296+
Any extra space resulting from a 'block-step-size'-induced adjustment
297+
is inserted on the <a>end</a> side of the box.
298+
</dl>
299+
300+
Rounding Method: the 'block-step-round' property {#block-step-round}
301+
------------------------------------------------
302+
303+
<pre class="propdef">
304+
Name: block-step-round
305+
Value: up | down | nearest
306+
Initial: up
307+
Applies to: block-level boxes
308+
Inherited: no
309+
Animatable: no
310+
Percentages: N/A
311+
Media: visual
312+
Computed Value: as specified
313+
</pre>
314+
315+
This property specifies whether adjustments due to 'block-step-size'
316+
insert positive or negative space.
317+
318+
Values have the following meanings:
319+
320+
<dl dfn-for="block-step-align" dfn-type="value">
321+
<dt><dfn>up</dfn>
322+
<dd>
323+
The outer size of the box is <em>increased</em>
324+
(positive space is inserted)
325+
to fulfill the 'block-step-size' constraint.
326+
327+
<dt><dfn>down</dfn>
328+
<dd>
329+
The outer size of the box is <em>decreased</em>
330+
(negative space is inserted)
331+
to fulfill the 'block-step-size' constraint.
332+
333+
<dt><dfn>nearest</dfn>
334+
<dd>
335+
The outer size of the box is either
336+
<em>increased</em> (as for ''up'') or <em>decreased</em> (as for ''down''--
337+
whichever results in the smallest absolute change--
338+
to fulfill the 'block-step-size' constraint.
339+
If both options would result in the same amount of change,
340+
the size is increased.
341+
</dl>
342+
343+
Block Step Adjustment Shorthand: the 'block-step' shorthand {#block-step}
344+
-----------------------------------------------------------
345+
346+
<pre class="propdef">
347+
Name: block-step
348+
Value: <'block-step-size'> || <'block-step-insert'> || <'block-step-align'> || <'block-step-round'>
349+
Initial: See individual properties
350+
Applies to: block-level boxes
351+
Inherited: no
352+
Animatable: See individual properties
353+
Percentages: N/A
354+
Media: visual
355+
Computed Value: See individual properties
356+
</pre>
357+
358+
This <a>shorthand property</a> allows for setting
359+
'block-step-size',
360+
'block-step-insert',
361+
'block-step-align',
362+
and
363+
'block-step-round'
364+
in one declaration.
365+
Omitted values are set to the property’s initial value.
366+
367+
Advisement: Authors are advised to use this shorthand rather than the longhands
368+
unless there is a specific need for its individual longhands to cascade independently.
183369

184370
Privacy and Security Considerations {#priv-sec}
185371
===============================================

0 commit comments

Comments
 (0)