Repository navigation
fix(layout): let a docs fitContent embed take the sample's height - #1318
Merged
Merged
Conversation
In a docs fitContent embed the page still filled the iframe, so a same-origin docs host measured the iframe height back and cut the sample off. Drop the viewport-bound heights once the host enables fit mode.
1 of 6 tasks
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the fit-mode height overrides.
No open issues 🎉
What changed in this PR
Fixes clipped docs fitContent embeds by letting the demo page take the sample’s height, so the same-origin docs host can measure it correctly.
Changes:
- Sets
height: autoonhtml,body,#shell, and#router-targetwhenhtml[data-igd-fit]is active. - Documents the sizing behavior and leaves pages outside fit mode unchanged.
| File | Description |
|---|---|
public/styles/layout.css |
Adds fit-mode height overrides so embedded demos size to their content. |
Review effort: Balanced
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
In a docs
<Sample fitContent>embed, the sample page stayed as tall as the iframe, becausehtml,body,#shelland#router-targetkeptheight: 100%. On staging the docs host shares the demos' origin and measures the page directly, so it read the iframe height back and cut the sample off. In fit mode (html[data-igd-fit]), those heights are nowauto, so the page is as tall as the sample. Pages outside a fitContent embed are unchanged.Closes #1317
Related: IgniteUI/igniteui-astro-components#193 and IgniteUI/igniteui-astro-components#194 fix the docs host side.
Testing
The deployed staging demos with this
layout.csssubstituted, served from one origin with the documentation site. On Palette Generation, the iframe height against the demo height, over three loads:layout.cssThis change fixes the cut-off without a docs component release.