Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

The PR #7433 CSS changes contained redundant declarations that can be removed while preserving the SSR layout shift fix.

Changes

Removed 32 lines of redundant CSS from PageLayout.module.css:

  • Base .PaneWrapper: Removed explicit margin: 0 declarations (already default)
  • Narrow viewport: Removed duplicate [data-position='end'] and [data-position='start'] selectors - base styles handle narrow correctly
  • All viewports: Removed unnecessary zero margin resets where the opposite side already sets the spacing margin

Essential changes preserved:

  • Base [data-position] stacked layout styles
  • Desktop @media (min-width: 768px) side-by-side overrides
  • .Pane[data-resizable] fix using var(--pane-width-size)

Changelog

Changed

  • Simplified PageLayout.module.css by removing 32 lines of redundant CSS

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

CSS linting, build, type checking, and format checking all pass. The diff is now minimal and focused on essential changes only.

Merge checklist

Original prompt

Problem

The current changes in PR #7433 have redundant CSS that can be removed to minimize the diff while still fixing the SSR layout shift issue.

Changes Needed

Simplify the CSS changes in packages/react/src/PageLayout/PageLayout.module.css to only include what's essential:

1. Remove redundant margin resets from base .PaneWrapper

Remove these lines that were added (margins are already 0 by default):

margin-top: 0;
margin-bottom: 0;

2. Remove redundant narrow viewport overrides

Inside @media (--viewportRange-narrow), remove the duplicate [data-position='end'] and [data-position='start'] selectors since the base styles now handle narrow viewports correctly. The [data-position-narrow='end'] and [data-position-narrow='start'] selectors should remain for explicit narrow overrides.

Also remove the unnecessary margin-left: 0 and margin-right: 0 from narrow selectors - these are already 0.

3. Remove unnecessary margin resets from regular/wide viewport selectors

Remove margin-right: 0 and margin-left: 0 from:

  • [data-position-regular='end']
  • [data-position-regular='start']
  • [data-position-wide='end']
  • [data-position-wide='start']

These aren't needed since we're explicitly setting the correct margin on the opposite side.

4. Keep the essential changes

Keep:

  • Base [data-position='end'] and [data-position='start'] with stacked layout styles
  • Desktop @media screen and (min-width: 768px) overrides for [data-position='end'] and [data-position='start']
  • The .Pane[data-resizable] fix: width: var(--pane-width-size) instead of width: 100%

Goal

Reduce the diff from ~42 additions/18 deletions to the minimal set of changes needed to fix the SSR layout shift, making it easier to review and reducing risk of unintended side effects.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 13b6465

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Remove redundant CSS for SSR layout shift issue Simplify PageLayout CSS by removing redundant margin resets Jan 8, 2026
Copilot AI requested a review from mattcosta7 January 8, 2026 12:28
@mattcosta7 mattcosta7 marked this pull request as ready for review January 8, 2026 12:46
@mattcosta7 mattcosta7 requested a review from a team as a code owner January 8, 2026 12:46
@mattcosta7 mattcosta7 requested a review from siddharthkp January 8, 2026 12:46
@mattcosta7 mattcosta7 merged commit 21b1925 into copilot/fix-ssr-layout-jump Jan 8, 2026
@mattcosta7 mattcosta7 deleted the copilot/simplify-css-changes branch January 8, 2026 12:46
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.

2 participants