feat(Page): update glass spacers#8427
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughPage component docked and glass-theme spacing tokens were adjusted: docked container uses the inset page-chrome spacer; glass sidebar and sidebar-main margins/padding recalculated to use gutter and smaller spacers; generated token files refreshed and a new ChangesGlass Theme Spacing Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview: https://pf-pr-8427.surge.sh A11y report: https://pf-pr-8427-a11y.surge.sh |
mcoker
left a comment
There was a problem hiding this comment.
Need to confirm with design:
- whether page-chrome token stays the same or should change to 16px.
- the mobile layout of the sidebar looks correct with the inset/offset
mcoker
left a comment
There was a problem hiding this comment.
Spotted these two issues:
- the masthead uses the "lg" spacer for it's left/right padding and that should be updated to use the page chrome spacer.
- the page content in the docked nav layout uses a "lg" top margin when it should use the gutter spacer on mobile (when there is a masthead visible) and the page chrome spacer on desktop (when the content is the first element on the page)
|
Actionable comments posted: 0 |
mcoker
left a comment
There was a problem hiding this comment.
Just a few comments on the vars. I still need to run visual regressions, but need to get them updated on the main branch first. Will re-review when those are updated.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/patternfly/components/Page/page.scss (1)
239-241:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winRemove duplicate variable definitions that break non-desktop spacing.
Lines 239-241 redefine the same variables already declared at lines 13, 14-15, and 16 within the same
@include pf-root($page)scope. Because CSS applies the last definition, these duplicates override the earlier declarations:
- Line 239 duplicates line 13 (same value, so no functional change)
- Line 240 overrides line 14, breaking the intended non-desktop behavior where
MarginBlockStartshould be0(line 14), notinset-page-chrome- Line 241 duplicates line 16 (same value, so no functional change)
The duplication makes lines 13-16 partially dead code and breaks the mobile/non-desktop spacing contract.
Based on learnings from past review comments, these duplicate lines should be removed entirely.
🔧 Proposed fix
- // Docked nav - --#{$page}--m-dock__main-container--MaxHeight: calc(100% - var(--pf-t--global--spacer--inset--page-chrome) * 2); - --#{$page}--m-dock__main-container--MarginBlockStart: var(--pf-t--global--spacer--inset--page-chrome); - --#{$page}--m-dock--ColumnGap: var(--pf-t--global--spacer--inset--page-chrome);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/patternfly/components/Page/page.scss` around lines 239 - 241, Remove the duplicate CSS custom-property declarations inside the same `@include` pf-root($page) scope: delete the extra definitions of --#{$page}--m-dock__main-container--MaxHeight, --#{$page}--m-dock__main-container--MarginBlockStart, and --#{$page}--m-dock--ColumnGap so the original declarations (which set MarginBlockStart to 0 for non-desktop) are not overridden; keep the earlier definitions intact and ensure no other code reintroduces these duplicates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/patternfly/components/Page/page.scss`:
- Around line 239-241: Remove the duplicate CSS custom-property declarations
inside the same `@include` pf-root($page) scope: delete the extra definitions of
--#{$page}--m-dock__main-container--MaxHeight,
--#{$page}--m-dock__main-container--MarginBlockStart, and
--#{$page}--m-dock--ColumnGap so the original declarations (which set
MarginBlockStart to 0 for non-desktop) are not overridden; keep the earlier
definitions intact and ensure no other code reintroduces these duplicates.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 21e2b489-fb22-48fa-a520-851d6be8a8d0
📒 Files selected for processing (1)
src/patternfly/components/Page/page.scss
1e6420a to
5cd7e7e
Compare
mcoker
left a comment
There was a problem hiding this comment.
Oops missed one spot. Looks like there are still duped vars here - https://github.com/kmcfaul/patternfly/blob/5cd7e7ef7b1fc9a170d0c5bcba6ce70eac4deab0/src/patternfly/components/Page/page.scss#L238-L241
You can delete the previously defined ones since those are not applying currently anyways. Then can you group these separate blocks so all of the vars are in a single docked nav section?
|
🎉 This PR is included in version 6.6.0-prerelease.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes: #8393
Updates sidebar spacer from lg to md token.
Updates the gap between masthead, sidebar, and content to use gutter token instead of page chrome. Outer spacers around the page should still be using page chrome token.
Summary by CodeRabbit
Style
Chores