Skip to content

fix(compass): box-shadow cut off#8366

Merged
mcoker merged 8 commits into
patternfly:mainfrom
jcmill:bug/8344-compass-shadow
May 13, 2026
Merged

fix(compass): box-shadow cut off#8366
mcoker merged 8 commits into
patternfly:mainfrom
jcmill:bug/8344-compass-shadow

Conversation

@jcmill

@jcmill jcmill commented May 4, 2026

Copy link
Copy Markdown
Contributor

Closes: #8344

Fixes clipped box-shadow in Compass component when using glass theme by adding padding and compensating negative margins on __content element.

Summary by CodeRabbit

  • New Features

    • Glass theme support: Compass adapts content spacing when the glass theme is active.
  • Style

    • Glass-specific spacing variables added so margins and padding inside Compass can be tuned while preserving layout and overflow behavior.
  • Chores / UX

    • Docked Compass examples and the docked panel now enable scrolling and auto-height; dock is shown expanded on mobile for improved usability.

Review Change Stack

@jcmill jcmill requested a review from mcoker May 4, 2026 19:47
@patternfly-build

patternfly-build commented May 4, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds glass-theme CSS custom properties for Compass content margin and padding, maps those --*--glass values into element-level Compass variables when .pf-v6-theme-glass is active, updates .compass__content to consume those variables with 0 fallbacks, and enables scrollable/auto-height flags in Compass demos.

Changes

Compass Glass Theme Spacing

Layer / File(s) Summary
CSS Variables Definition
src/patternfly/components/Compass/compass.scss
Adds --#{$compass}__content--MarginBlockStart--glass, --#{$compass}__content--MarginBlockEnd--glass, --#{$compass}__content--MarginInlineStart--glass, --#{$compass}__content--MarginInlineEnd--glass, --#{$compass}__content--PaddingBlockStart--glass, --#{$compass}__content--PaddingBlockEnd--glass, --#{$compass}__content--PaddingInlineStart--glass, and --#{$compass}__content--PaddingInlineEnd--glass in the Compass root scope.
Theme Wiring
src/patternfly/components/Compass/compass.scss
Adds :where(.pf-v6-theme-glass) & rule mapping the component-level --#{$compass}__content--Margin* and --#{$compass}__content--Padding* variables to the corresponding --*--glass variants when the glass theme is active.
Component Styling
src/patternfly/components/Compass/compass.scss
Updates .#{$compass}__content to set padding-* and margin-* from --#{$compass}__content--Padding* / --#{$compass}__content--Margin* with 0 fallbacks; existing flex column and overflow: auto remain unchanged.
Demo Panel Flags
src/patternfly/demos/Compass/compass--docked.hbs
Make the main glass panel scrollable and auto-height by adding panel--IsScrollable=true and panel--IsScrollableAutoHeight=true.
Docs / Examples
src/patternfly/demos/Compass/examples/Compass.md
Update "Docked nav - expanded on mobile" example to pass dock modifiers compass-dock--IsScrollable=true and compass-dock--IsAutoHeight=true in addition to compass-dock--IsExpanded=true.

Sequence Diagram(s)

(omitted — changes are CSS and demo wiring without a multi-component sequential control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mcoker
  • kmcfaul
  • thatblindgeye

Suggested labels

released on @prerelease``

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Changes to panel scrollability and auto-height in the demo templates appear slightly tangential to the CSS fix for shadow clipping but support the overall goal. Clarify whether panel scrollability changes are necessary to fix the shadow clipping or if they are separate improvements unrelated to issue #8344.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title follows conventional commit format with 'fix' prefix and concise description of the box-shadow clipping issue.
Linked Issues check ✅ Passed The changes address the core issue #8344 by adding padding/margin CSS variables to prevent box-shadow clipping in the Compass glass theme.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/patternfly/components/Compass/compass.scss`:
- Around line 400-407: The stylelint properties order is wrong in the Compass
component block: move block-axis properties before inline-axis properties to
satisfy order/properties-order; specifically reorder the rules that use the
--#{$compass}__content--* variables so the sequence is margin-block-start,
margin-block-end, padding-block-start, padding-block-end, then
margin-inline-start, margin-inline-end, padding-inline-start, padding-inline-end
(update the block in compass.scss where these CSS custom properties are
declared).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9cfa962b-6c8f-4680-bef9-8dbf13b43abf

📥 Commits

Reviewing files that changed from the base of the PR and between 73de430 and 7979f27.

📒 Files selected for processing (1)
  • src/patternfly/components/Compass/compass.scss

Comment thread src/patternfly/components/Compass/compass.scss Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/patternfly/components/Compass/compass.scss (1)

400-407: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reorder __content margin/padding declarations to satisfy stylelint.

This block still fails CI (order/properties-order) at Line 402 and Line 406. Please reorder the declarations so padding-block-start comes before margin-block-end, and padding-inline-start comes before margin-inline-end.

✅ Suggested reorder
   margin-block-start: var(--#{$compass}__content--MarginBlockStart, 0);
-  margin-block-end: var(--#{$compass}__content--MarginBlockEnd, 0);
   padding-block-start: var(--#{$compass}__content--PaddingBlockStart, 0);
+  margin-block-end: var(--#{$compass}__content--MarginBlockEnd, 0);
   padding-block-end: var(--#{$compass}__content--PaddingBlockEnd, 0);
   margin-inline-start: var(--#{$compass}__content--MarginInlineStart, 0);
-  margin-inline-end: var(--#{$compass}__content--MarginInlineEnd, 0);
   padding-inline-start: var(--#{$compass}__content--PaddingInlineStart, 0);
+  margin-inline-end: var(--#{$compass}__content--MarginInlineEnd, 0);
   padding-inline-end: var(--#{$compass}__content--PaddingInlineEnd, 0);
🤖 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/Compass/compass.scss` around lines 400 - 407, The
stylelint ordering error in the Compass __content block is caused by padding
properties placed after their corresponding margin properties; in the CSS rule
that uses the --#{$compass}__content custom properties, move padding-block-start
so it appears before margin-block-end, and move padding-inline-start so it
appears before margin-inline-end, preserving the existing var(...) values for
padding-block-start, padding-block-end, padding-inline-start, and
padding-inline-end and keeping margin-block-start/margin-inline-start where they
are; update the declarations order in the block that contains
margin-block-start, margin-block-end, padding-block-start, padding-block-end,
margin-inline-start, margin-inline-end, padding-inline-start, padding-inline-end
to satisfy the order/properties-order rule.
🤖 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.

Inline comments:
In `@src/patternfly/components/Compass/compass.scss`:
- Around line 93-102: The glass theme selector currently uses
":where(.pf-v6-theme-glass) &" which triggers the
nesting-selector-no-missing-scoping-root lint; update that selector to
":root:where(.pf-v6-theme-glass) &" where the CSS custom properties for the
Compass component (the --#{$compass}__content--* variables block) are defined so
the theme scoping matches the pattern used elsewhere and satisfies the linter.

---

Duplicate comments:
In `@src/patternfly/components/Compass/compass.scss`:
- Around line 400-407: The stylelint ordering error in the Compass __content
block is caused by padding properties placed after their corresponding margin
properties; in the CSS rule that uses the --#{$compass}__content custom
properties, move padding-block-start so it appears before margin-block-end, and
move padding-inline-start so it appears before margin-inline-end, preserving the
existing var(...) values for padding-block-start, padding-block-end,
padding-inline-start, and padding-inline-end and keeping
margin-block-start/margin-inline-start where they are; update the declarations
order in the block that contains margin-block-start, margin-block-end,
padding-block-start, padding-block-end, margin-inline-start, margin-inline-end,
padding-inline-start, padding-inline-end to satisfy the order/properties-order
rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: be2b23ce-2544-4686-b1b3-6765cee31491

📥 Commits

Reviewing files that changed from the base of the PR and between 7979f27 and cf0e91b.

📒 Files selected for processing (1)
  • src/patternfly/components/Compass/compass.scss

Comment thread src/patternfly/components/Compass/compass.scss

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/patternfly/components/Compass/compass.scss (1)

93-102: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

nesting-selector-no-missing-scoping-root lint error still present — add :root prefix.

The selector on line 93 is :where(.pf-v6-theme-glass) &, which stylelint flags for the missing scoping root. This is inconsistent with the dark-theme selector in the same file (line 143: :root:where(.#{$pf-prefix}theme-dark) &).

💡 Proposed fix
-  :where(.pf-v6-theme-glass) & {
+  :root:where(.pf-v6-theme-glass) & {
🤖 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/Compass/compass.scss` around lines 93 - 102, The
selector ":where(.pf-v6-theme-glass) &" triggers the
nesting-selector-no-missing-scoping-root lint rule; update the rule-violating
selector to include the :root scoping prefix (matching the dark-theme pattern
used elsewhere) so it becomes ":root:where(.pf-v6-theme-glass) &" (ensure you
modify the selector that wraps the CSS custom properties for the $compass
component rather than the property names themselves).
🤖 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/Compass/compass.scss`:
- Around line 93-102: The selector ":where(.pf-v6-theme-glass) &" triggers the
nesting-selector-no-missing-scoping-root lint rule; update the rule-violating
selector to include the :root scoping prefix (matching the dark-theme pattern
used elsewhere) so it becomes ":root:where(.pf-v6-theme-glass) &" (ensure you
modify the selector that wraps the CSS custom properties for the $compass
component rather than the property names themselves).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 53d85141-c783-4ff4-8618-3e0db8a0363b

📥 Commits

Reviewing files that changed from the base of the PR and between cf0e91b and 713f27d.

📒 Files selected for processing (1)
  • src/patternfly/components/Compass/compass.scss

@jcmill jcmill changed the title bug(compass): box-shadow cut off fix(compass): box-shadow cut off May 5, 2026
Comment thread src/patternfly/demos/Compass/examples/Compass.md Outdated
Comment thread src/patternfly/components/Compass/compass.scss Outdated

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎃👍

@mcoker mcoker merged commit 8d12c56 into patternfly:main May 13, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.91 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jcmill jcmill deleted the bug/8344-compass-shadow branch June 12, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Compass - shadows are cut off in main layout

4 participants