Skip to content

[6.x] Some CSS rendering performance optimisations - #15156

Merged
jaygeorge merged 6 commits into
6.xfrom
css-contain-and-content-visibility-performance-optimisations
Aug 11, 2026
Merged

[6.x] Some CSS rendering performance optimisations#15156
jaygeorge merged 6 commits into
6.xfrom
css-contain-and-content-visibility-performance-optimisations

Conversation

@jaygeorge

Copy link
Copy Markdown
Contributor

Description of the Problem

Parts of the CP are self-contained UI “islands” (stacks, asset tiles, listing rows, page-tree branches, fieldtype picker cards). Without CSS containment, small updates inside those islands can force the browser to reconsider layout for much larger parts of the page.

This may bet be noticeable in normal use, but we can make small/cheap changes here to optimise things for the browser.

What this PR Does

Uses CSS's containment and content-visibility properties to isolate browser rendering.

This is low-risk CSS rendering isolation.

  • contain: layout on stacks, asset tiles, listing table rows, and fieldtype picker cards — keeps internal layout work local without clipping shadows, outlines, or menus.
  • content-visibility: auto (+ intrinsic size) on page-tree branches — skips layout/paint for off-screen rows
  • Removes a dead .fieldtype-list rule (grid now lives in FieldtypeSelector.vue)

I've intentionally avoided paint/content containment and content-visibility on parts of the CP that are variable-height such as the publish form, where there's a risk of increasing cumulative layout shift (CLS) and clipping.

How to Reproduce

  1. Stacks — open an asset editor or relationship browse stack; interact inside it
  2. Asset tiles/cp/assets grid; select tiles, open menus
  3. Page tree/cp/nav/default/edit (expand all, scroll, drag) or a structured collection tree
  4. Listing rows/cp/collections/pages (or any index); hover/select rows
  5. Fieldtype picker — edit a blueprint → Add Field

Expect little visible change when the CPU is idle. Worth checking for clipped shadows/outlines, jumpy scroll on large trees, and drag-and-drop still feeling correct on the nav/page tree.

@jaygeorge jaygeorge changed the title Css contain and content visibility performance optimisations [6.x] Some CSS rendering performance optimisations Aug 11, 2026
@jaygeorge
jaygeorge merged commit d5eceaa into 6.x Aug 11, 2026
119 of 123 checks passed
@jaygeorge
jaygeorge deleted the css-contain-and-content-visibility-performance-optimisations branch August 11, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant