Keep height floors on responsive canvas sections#652
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.
Summary
Desktop-only Figma exports frequently contain canvas-positioned sections: fixed-height frames without auto-layout whose children are all absolutely positioned. The desktop-only responsive fallback relaxed those sections to
height:autoat viewports below the canvas width, but skipped themin-heightfloor whenever the section had a container child — assuming flow children would size the box. Canvas children are out of flow, so the sections collapsed to zero height and entire page regions (hero, about, testimonials, CTA bands) vanished at any viewport under the design canvas.Change
In
BreakpointMediaDiffBuilder::desktopOnlyResponsiveFallbackDeclarations, a container whose base display is not flex/grid is treated as canvas-positioned and always keeps the capped source-height floor (min-height:min(height, 720px)) alongsideheight:auto. Flex/grid containers keep the existing behavior.Measured impact
Twenty Twenty-Five (Community) .fig front page at a 1280px viewport:
How to test
cd figma-transformer && composer test— the contract suite includes a new desktop-only canvas-sections fixture assertingheight:autoplusmin-height:453px/min-height:720px/min-height:460pxin the@media (max-width:1439px)block for hero/about/CTA bands whose only children are absolutely positioned.desktop-only-responsive-hero-row-has-no-fixed-min-height-floor...) still pass, proving flex/grid containers keep the floor-free stacking behavior.AI disclosure
Implemented with OpenCode using
openai/gpt-5.6-sol; the contract suite and the end-to-end fixture matrix were run locally.