Repository navigation
Keep Core's cover padding off stylesheet-painted sources - #6146
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A stylesheet-painted hero becomes a
core/cover, and Core gives.wp-block-coverpadding: 1em. The source box has no padding of its own, so any side the author stylesheet leaves unset picks up Core's 1em. On a real Webflow import, a contact section declared onlypadding-top: 0; padding-bottom: 150px, so 14 px leaked in on each side and both columns lost 14 px of width (636 px instead of 650 px).The flex/grid and auto-height branches of
CoverPatternalready zero the padding inline. A plain block-display hero with a min-height takes neither branch.Change
EngineSupportCss::coreDefaultResetCss()adds:root :where(.wp-block-cover.blocks-engine-cover-consumed-background){padding:0}next to the other core-default resets. It is emitted before the author CSS at single-class weight, so it beats Core's rule and every authored padding still wins. With author cascade layers it uses the existingrevert-layerbridge.Evidence
tests/unit/cover-default-padding-browser.mjsruns the real transformer, then renders the output with WordPress'sblock-library/style.min.cssin WordPress's load order. It checks the computed padding and the content box against the source, table-driven over an author who sets only top/bottom and one who sets all four sides.0 16px 150px 16px, content 1408 px wide ✗0 0 150px 0, content 1440 px ✓ (matches source)Gates run locally (Lab runner unavailable):
composer test:parity: 357/357.engine-support-css,engine-support-css-assetandcover-patternunit tests pass.30-cursed-pangolin-fanwikidivergence that trunk also shows in this PHP 8.5 environment.composer test:scripts: 1546/1549. The three Chrome contracts (artwork-slideshow,component-interactions,positioned-carousel-stage) fail on trunk locally too.AI disclosure: Franklin (Claude, via the Pi coding agent) traced the gap on a live import with CDP matched-style inspection, wrote the change and the browser regression test, and ran the gates.