Skip to content

feat(card): add isGlass prop#12290

Merged
thatblindgeye merged 2 commits intopatternfly:mainfrom
wise-king-sullyman:card-glass-followup
Mar 27, 2026
Merged

feat(card): add isGlass prop#12290
thatblindgeye merged 2 commits intopatternfly:mainfrom
wise-king-sullyman:card-glass-followup

Conversation

@wise-king-sullyman
Copy link
Copy Markdown
Collaborator

@wise-king-sullyman wise-king-sullyman commented Mar 24, 2026

What: Closes #12268

Additional issues:

Assisted by Claude Code

Summary by CodeRabbit

  • New Features

    • Card component gains a glass visual style option—use the new property to apply a glass appearance to card elements.
  • Tests

    • Added a unit test confirming the glass visual modifier is applied to the card when the style is enabled.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6b9adea-4319-41ff-b4ac-21df202172b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7bf0c2c and 7fc63e6.

📒 Files selected for processing (1)
  • packages/react-core/src/components/Card/Card.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-core/src/components/Card/Card.tsx

Walkthrough

The Card component now accepts an optional isGlass boolean prop; when true, the component's root element receives the pf-m-glass CSS modifier. A unit test was added to verify the class is applied.

Changes

Cohort / File(s) Summary
Card component enhancement
packages/react-core/src/components/Card/Card.tsx
Added optional isGlass?: boolean to CardProps; CardBase destructures isGlass (default false) and conditionally appends styles.modifiers.glass to the root className when truthy.
Card test coverage
packages/react-core/src/components/Card/__tests__/Card.test.tsx
Added a test asserting the pf-m-glass modifier class is present on the card root when isGlass is passed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an isGlass prop to the Card component.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #12268 by adding the isGlass modifier to the Card component that applies the 'pf-m-glass' CSS class.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the isGlass prop for the Card component as specified in the linked issue; no extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Mar 24, 2026

@wise-king-sullyman wise-king-sullyman requested review from a team, nicolethoen and thatblindgeye and removed request for a team March 24, 2026 19:31
isFullHeight?: boolean;
/** Modifies the card to include plain styling; this removes border and background */
isPlain?: boolean;
/** Modifies the card to include glass styling */
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.

would it be worth clarifying that it'll include glass styling when the glass contrast mode is enabled?

Copy link
Copy Markdown
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Speaking with Coker + Nicole's above comment

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
@thatblindgeye thatblindgeye merged commit f854fa6 into patternfly:main Mar 27, 2026
14 of 15 checks passed
@patternfly-build
Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-code-editor@6.5.0-prerelease.45
  • @patternfly/react-core@6.5.0-prerelease.42
  • @patternfly/react-docs@7.5.0-prerelease.51
  • @patternfly/react-drag-drop@6.5.0-prerelease.43
  • demo-app-ts@6.5.0-prerelease.71
  • @patternfly/react-table@6.5.0-prerelease.43
  • @patternfly/react-templates@6.5.0-prerelease.42

Thanks for your contribution! 🎉

@wise-king-sullyman wise-king-sullyman deleted the card-glass-followup branch March 27, 2026 20:36
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.

Card - Glass styles react followup

5 participants