Skip to content

fix(layout): let a docs fitContent embed take the sample's height - #1318

Merged
simeonoff merged 1 commit into
vnextfrom
fix/fit-content-viewport-height
Nov 12, 2026
Merged

simeonoff merged 1 commit into
vnextfrom
fix/fit-content-viewport-height

Conversation

@simeonoff

Copy link
Copy Markdown
Member

Summary

In a docs <Sample fitContent> embed, the sample page stayed as tall as the iframe, because html, body, #shell and #router-target kept height: 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 now auto, 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.css substituted, served from one origin with the documentation site. On Palette Generation, the iframe height against the demo height, over three loads:

seeds sweep scales neutrals
current layout.css 92 / 460 144 / 1011 173 / 1356 144 / 1010
this branch 460 / 460 1011 / 1011 1356 / 1356 1010 / 1010

This change fixes the cut-off without a docs component release.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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: auto on html, body, #shell, and #router-target when html[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

@simeonoff
simeonoff merged commit eeb48b0 into vnext Nov 12, 2026
5 checks passed
@simeonoff
simeonoff deleted the fix/fit-content-viewport-height branch November 12, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs fitContent embeds are cut off on staging: the page keeps the iframe's height

2 participants