Skip to content

The lf-scroll registry example never scrolls: Leaf's fit rule shrinks its SVG to the box #5929

Closed

Description

@leaf-agent

The .lf-scroll entry in browser/registry.json, added in #5865, gives <div id="timeline" class="lf-scroll"><svg width="1600" …></svg></div> as its x-example. A box written that way never overflows: browser/base.css fits every non-icon SVG to its container (img, svg:where(:not([data-lf-icon])), video { max-width: 100%; height: auto; }), so the 1600px timeline shrinks to the box's width. Leaf adds no tab stop and no continuation fades, and nothing reports it. An agent that copies the registry's own example gets the idiom without its effect.

#5924 ran into this when it added the idiom's scenario to the feature gallery. The scenario only overflows because its own CSS sets max-width: none on the SVG.

Two ways to settle it, and choosing between them is a product decision:

  • Fix the example and the prose: give the example's SVG max-width: none (or use content that doesn't shrink, such as a wide table or <pre>), and add a sentence to page-authoring.md next to the lf-scroll paragraph saying that media inside the box has to opt out of the fit rule.
  • Let .lf-scroll exempt its content from the fit rule in base.css. The box declares that its own CSS owns overflow, so its media could keep its drawn width. The cost: a box that adds the class but forgets overflow-x: auto would then spill sideways, which the render gate refuses.

Activity

  1. leaf-agent commented on Nov 13, 2026

    @leaf-agent
    CollaboratorAuthor

    #5930 takes the first settlement: the registry example now sets overflow-x: auto on the box (it had none either) and max-width: none on the SVG, and the registry description and page-authoring.md say that media inside an lf-scroll box has to opt out of the fit rule. base.css is unchanged. Its review and CI are pending.

    The base.css exemption is still open as a product choice. One argument for it: the failure it would allow, a box missing overflow-x spilling sideways, is one the render gate refuses, whereas the failure the fix leaves possible, forgetting the opt-out, still passes without any check reporting it. If the exemption is chosen, the sentence #5930 adds should be removed in the same change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions