Repository navigation
Description
Description
The block-step-size, block-step-insert, block-step-align and block-step-round properties and the block-step shorthand from CSS Rhythmic Sizing Level 1. They round the outer size of a block box up to a multiple of a given step to maintain vertical rhythm.
In scope:
- value parsing,
- layout for every value of all four properties,
- behavior with different
box-sizingvalues, - behavior in vertical writing modes and on replaced elements.
Out of scope:
line-height-stepfrom the same module — browsers are not going to support it. The property is now pointless: line rhythm is handled by thelhandrlhunits, which are available everywhere;line-gridand anything else that is not in Level 1;- areas where the CSSWG has no resolution yet:
- fragmentation and margins at breaks,
- interaction with floats and with
aspect-ratio.
Rationale
Vertical rhythm is as old as the web. Aligning lines of text to a single grid, especially across neighboring columns, still has only one cross-browser solution: scripts, which make the interface janky.
Both CSS hacks are still not Baseline Newly Available, and they are awkward on top of that. My demo shows both techniques: a scroll-driven animation and a calc-size() trick. The first is so bulky that it is easier to keep it in a separate file. The second, among other things, rounds the block's own height but not its outer size. On top of that, each hack has its own cost and a whole set of serious limitations (described in the demo). All of this instead of a single line, such as block-step: 1rlh margin-box start.
The lh and rlh units covered only part of the need. Vincent Bernat's article (April 2026) shows this best: he aligns text with rlh, but for responsive images he writes that "CSS Rhythmic Sizing Module Level 1 introduces the block-step property… But most browsers don't support it yet" and provides JavaScript with ResizeObserver that adds padding.
The text-box-* properties are not about vertical rhythm. They will probably be useful for rhythm, but only as a complement to the block-step-* properties. On their own they do nothing for rhythm; they merely trim the invisible space above and/or below the text.
Rhythm is not just "a multiple of the line". An image next to a column of text looks level with it only when its bottom sits on a baseline and its height equals a whole number of lines plus the cap height — with the x-height instead, the top of the image looks lower than the neighboring lines of text. The demo does this, but crudely because of the limitations, and block-step will make it far simpler and more flexible.
Signals in the trackers. Bugzilla 1339311 "[META] Implement CSS Rhythmic Sizing" (6 votes), 1387501 "Implement block step sizing" (5 votes), WebKit 167333 and 252357, developer-signals #315 (a product-card scenario with three workarounds), caniuse #6642. There are no use counters because there are no implementations. Demand by property name is close to zero — people do not know the properties exist.
Implementers are working on the module. WebKit has started an implementation. In 2025 the CSSWG discussed the module at several meetings and adopted three resolutions; issues were opened by Apple and Google. The Working Draft was republished on 17 February 2026. This is not an abandoned specification; it is a specification that needs one last push.
Investigation Roadmap
This section was drafted by an LLM; I only proofread it and removed what was unnecessary.
Current specification: CSS Rhythmic Sizing Module Level 1, a W3C Working Draft on the Recommendation Track, https://www.w3.org/TR/css-rhythm-1/; editor's draft https://drafts.csswg.org/css-rhythm-1/. Current tests: https://github.com/web-platform-tests/wpt/tree/master/css/css-rhythm, 35 files, 6 of which test behavior that has since been revoked. Demonstration of the problem and the workarounds: https://firefoxic.github.io/block-step-demo/.
Tasks, in order of increasing dependency on each other. Specification work happens in the CSSWG and is done by the group's members.
- Apply the three adopted resolutions to the ED text:
- #11325:
block-step-sizedoes not establish an independent formatting context. - #1902:
block-step-sizeis inherited, the initial value ofblock-step-alignisnone, and it isblock-step-alignthat turns rounding on. - #11206: interaction with
align-contentandalign-self.
Two are labeled Needs Edits, the third is still open; the oldest resolution is more than a year and a half old.
- #11325:
- Close the margin-collapsing design question — #11514, raised by Tab Atkins and Ian Kilpatrick in January 2025. One option under discussion is to apply the adjustment as clearance rather than by changing the margins. This is the only genuinely open design question, and it affects every test about margins.
- Settle the scope of Level 1. The specification itself carries an ISSUE saying the level may be reduced to
block-step-sizeandblock-step-insert. The answer changes both the amount of testing and the amount of implementation work. Along the way — #12347 about renaming theblock-step-insertvalues toinside/outside. - Put the tests in order. Six
*-establishes-*-formatting-context*tests check the revoked behavior and are to be rewritten or removed once the text is fixed. Layout is currently covered only forblock-step-sizewith the default values of the other properties; 18 missing tests have been written, and a PR to WPT is being prepared. Tests for inheritance,align-contentand margins, however, can only be written after items 1 and 2. - Get engine positions. Neither
mozilla/standards-positionsnorWebKit/standards-positionshas a request about rhythmic sizing. Gecko is the only engine with no work at all, so a Mozilla position request is needed before selection. Chromium has no position either, and the stale chromestatus entry forline-height-stepis misleading and should be corrected. - Bring at least one implementation to a flag that can be enabled in a run. WebKit already has parsing and part of layout; the open bugs 252357, 252859, 253105 and their neighbors are about layout logic. The wpt.fyi runs go with the flag off, so even the existing implementation is invisible on the dashboard.
- Fix web-features. The
rhythmic-sizingfeature is described only in terms ofline-height-step, even though the wholecss/css-rhythm/directory is tagged with it.block-stepdeserves a feature of its own, or at least a mention in the description — otherwise Baseline will show nonsense even after the properties are implemented.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity