Skip to content

fix(card): card glass overrides#8307

Merged
mcoker merged 5 commits into
patternfly:mainfrom
jcmill:fix/8304-card-glass-overrides
Apr 15, 2026
Merged

fix(card): card glass overrides#8307
mcoker merged 5 commits into
patternfly:mainfrom
jcmill:fix/8304-card-glass-overrides

Conversation

@jcmill

@jcmill jcmill commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #8304 by scoping Card pf-m-glass styling to the glass theme and preventing style bleed in plain cards from backdrop-filter in that context.

Potential fix for #8260

Summary by CodeRabbit

  • Style
    • Updated card component styling with improved glass theme support and visual consistency
    • Refined plain card styling with enhanced backdrop filter treatment

@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Modified Card component SCSS to scope glass-card modifier styles within a .pf-v6-theme-glass context instead of globally, preventing glass variant styles from overriding default card styles outside the theme. Added explicit backdrop-filter: none; for plain cards.

Changes

Cohort / File(s) Summary
Card Glass Variant Scoping
src/patternfly/components/Card/card.scss
Scoped .pf-m-glass modifier styling to .pf-v6-theme-glass context; added explicit backdrop-filter: none; for .pf-m-plain cards; removed --BorderStyle setting from glass modifier.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • #8301 — Modifies .pf-m-plain card rules in parallel with glass styling adjustments
  • #8207 — Related glass modifier scoping and backdrop-filter behavior changes in Card component

Suggested labels

released on @prerelease``

Suggested reviewers

  • mcoker
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commit format with 'fix' type and descriptive subject about card glass overrides, accurately summarizing the main change.
Linked Issues check ✅ Passed The PR directly addresses issue #8304 by scoping glass modifier styles to the glass theme context and preventing backdrop-filter bleed in plain cards.
Out of Scope Changes check ✅ Passed All changes are scoped to card.scss and directly address glass styling issues; no out-of-scope modifications detected.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

❤️ 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.

🧹 Nitpick comments (1)
src/patternfly/components/Card/card.scss (1)

146-155: Glass scoping correctly applied, but inconsistent with other components.

The :where(.pf-v6-theme-glass) & scoping properly isolates glass styles to the theme context with zero specificity. However, this creates a pattern inconsistency: Panel and Drawer components still apply .pf-m-glass styling globally without .pf-v6-theme-glass scoping. Consider whether those components should follow the same scoping pattern for consistency across the component library.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/components/Card/card.scss` around lines 146 - 155, Card's
glass styles are correctly scoped using :where(.pf-v6-theme-glass) & with the
.pf-m-glass modifier, but Panel and Drawer still apply .pf-m-glass globally;
update those components (Panel and Drawer SCSS) to match Card by wrapping their
.pf-m-glass rules inside the same zero-specificity scope pattern (use
:where(.pf-v6-theme-glass) & { &.pf-m-glass { ... } }) so glass styling is
consistently applied only within the theme context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/patternfly/components/Card/card.scss`:
- Around line 146-155: Card's glass styles are correctly scoped using
:where(.pf-v6-theme-glass) & with the .pf-m-glass modifier, but Panel and Drawer
still apply .pf-m-glass globally; update those components (Panel and Drawer
SCSS) to match Card by wrapping their .pf-m-glass rules inside the same
zero-specificity scope pattern (use :where(.pf-v6-theme-glass) & { &.pf-m-glass
{ ... } }) so glass styling is consistently applied only within the theme
context.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 683669ba-eccb-4229-8ed5-683306449173

📥 Commits

Reviewing files that changed from the base of the PR and between 8e414b8 and 734b4d7.

📒 Files selected for processing (1)
  • src/patternfly/components/Card/card.scss

@patternfly-build

patternfly-build commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

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

lgtm!

@mcoker mcoker merged commit ca2af6b into patternfly:main Apr 15, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

The release is available on:

Your semantic-release bot 📦🚀

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 - Card - glass styles overriding default card styles

3 participants