Skip to content

feat(card): update card to use unified theme tokens#8219

Merged
mcoker merged 23 commits into
patternfly:mainfrom
wise-king-sullyman:card-unified-theme-token-updates-2
Mar 13, 2026
Merged

feat(card): update card to use unified theme tokens#8219
mcoker merged 23 commits into
patternfly:mainfrom
wise-king-sullyman:card-unified-theme-token-updates-2

Conversation

@wise-king-sullyman

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

Copy link
Copy Markdown
Collaborator

Closes #8086

Figma: https://www.figma.com/design/qRn3S225WwGHIdgGZX0LTC/Unified-Theme--Design-Tokens--Styles---Specs?node-id=9552-14258&p=f&t=AmaPrRnVNe38gCx6-0

Convenience link: https://pf-pr-8180.surge.sh/components/card

Redo of #8180

Summary by CodeRabbit

  • Style
    • Updated card component styling for improved border colors, box shadows, and interactive states (selectable, clickable, tile variants).
    • Modernized icon rendering across card templates and examples with PatternFly icon components for consistent visual presentation.

@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Updates the Card component with new SCSS variables and state handling for selectable, plain, and tile variants, including BoxShadow and BorderColor tokens. Additionally, all Card demo templates are updated to replace inline Font Awesome icons with PatternFly pfIcon helper calls.

Changes

Cohort / File(s) Summary
Card Styling
src/patternfly/components/Card/card.scss
Introduced BoxShadow variable and enhanced selectable/plain/tile state handling with appropriate BorderColor, BorderWidth, and BoxShadow defaults. Added at-root rules for tile selectable interactions and color/width propagation for selectable/clickable combinations.
Card Demo Templates
src/patternfly/demos/Card/card-template-gallery.hbs, src/patternfly/demos/Card/Card.md, src/patternfly/demos/Card/templates/card-demo--popover-table.hbs, src/patternfly/demos/Card/templates/card-demo--status-card.hbs, src/patternfly/demos/Card/templates/card-demo--template-gallery.hbs, src/patternfly/demos/Card/templates/card-template-data-list.hbs, src/patternfly/demos/Card/templates/card-template-events.hbs, src/patternfly/demos/Card/templates/card-template-expandable-status-card.hbs, src/patternfly/demos/Card/templates/card-template-expandable-status.hbs, src/patternfly/demos/Card/templates/card-template-status.hbs
Replaced inline FontAwesome icon markup (<i class="fas ...">) with PatternFly pfIcon helper calls ({{pfIcon "rh-ui-..."}}), including proper icon/icon-content wrapper structures and semantic modifiers (pf-m-success, pf-m-danger, pf-m-warning) across all Card demo templates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Issue #8086 (Card: Token updates for unified theme) — The SCSS changes directly implement the unified theme token updates with new BoxShadow variables and enhanced state handling for tile, selectable, and plain variants as specified in the design tokens.

Possibly related PRs

Suggested labels

Needs design review

Suggested reviewers

  • lboehling
  • mcoker
  • andrew-ronaldson
  • kmcfaul
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows conventional commit guidelines with the correct format 'feat(card): ...' indicating a feature change to the card component.
Linked Issues check ✅ Passed The PR successfully implements unified theme token updates for the Card component as specified in issue #8086, including SCSS changes and icon migrations.
Out of Scope Changes check ✅ Passed All changes are directly related to card component token updates and icon migrations. No unrelated or out-of-scope modifications were detected.

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

📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

@patternfly-build

patternfly-build commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/patternfly/demos/Card/examples/Card.md`:
- Around line 633-636: The icon used for the success/Ready status is
inconsistent: inside the block that uses icon-content--modifier="pf-m-success"
and the pfIcon helper (the icon/icon-content pair rendering a "Ready" status),
replace the pfIcon argument "rh-ui-error-fill" with "rh-ui-check-circle-fill" so
the icon name matches the success modifier (look for the {{#> icon
icon--modifier="pf-m-inline"}} / {{#> icon-content
icon-content--modifier="pf-m-success"}} block and the {{pfIcon
"rh-ui-error-fill"}} call).
- Around line 582-585: The template uses the pfIcon helper inside the
icon-content block with icon-content--modifier="pf-m-success" but passes
"rh-ui-error-fill", which mismatches the success modifier; update the pfIcon
call to use "rh-ui-check-circle-fill" (replace the "rh-ui-error-fill" string) so
the icon matches the pf-m-success visual semantics in the Card example.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 10cdc23c-07c2-4200-9e9b-21fa1a8a7365

📥 Commits

Reviewing files that changed from the base of the PR and between 666007f and 68f2a25.

📒 Files selected for processing (11)
  • src/patternfly/components/Card/card.scss
  • src/patternfly/demos/Card/card-template-gallery.hbs
  • src/patternfly/demos/Card/examples/Card.md
  • src/patternfly/demos/Card/templates/card-demo--popover-table.hbs
  • src/patternfly/demos/Card/templates/card-demo--status-card.hbs
  • src/patternfly/demos/Card/templates/card-demo--template-gallery.hbs
  • src/patternfly/demos/Card/templates/card-template-data-list.hbs
  • src/patternfly/demos/Card/templates/card-template-events.hbs
  • src/patternfly/demos/Card/templates/card-template-expandable-status-card.hbs
  • src/patternfly/demos/Card/templates/card-template-expandable-status.hbs
  • src/patternfly/demos/Card/templates/card-template-status.hbs

Comment on lines 582 to 585
{{#> icon-content icon-content--modifier="pf-m-success"}}
<i class="fas fa-exclamation-circle" aria-hidden="true"></i>
{{pfIcon "rh-ui-error-fill"}}
{{/icon-content}}
{{/icon}}

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.

⚠️ Potential issue | 🟡 Minor

Icon name and modifier mismatch.

The icon "rh-ui-error-fill" is used with the pf-m-success modifier, which appears inconsistent. For a "Ready" status with a success modifier, the icon should likely be "rh-ui-check-circle-fill" to match the visual semantics.

🐛 Proposed fix
                  {{#> icon icon--modifier="pf-m-inline"}}
                    {{#> icon-content icon-content--modifier="pf-m-success"}}
-                    {{pfIcon "rh-ui-error-fill"}}
+                    {{pfIcon "rh-ui-check-circle-fill"}}
                    {{/icon-content}}
                  {{/icon}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/demos/Card/examples/Card.md` around lines 582 - 585, The
template uses the pfIcon helper inside the icon-content block with
icon-content--modifier="pf-m-success" but passes "rh-ui-error-fill", which
mismatches the success modifier; update the pfIcon call to use
"rh-ui-check-circle-fill" (replace the "rh-ui-error-fill" string) so the icon
matches the pf-m-success visual semantics in the Card example.

Comment on lines 633 to 636
{{#> icon icon--modifier="pf-m-inline"}}
{{#> icon-content icon-content--modifier="pf-m-success"}}
<i class="fas fa-exclamation-circle" aria-hidden="true"></i>
{{pfIcon "rh-ui-error-fill"}}
{{/icon-content}}

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.

⚠️ Potential issue | 🟡 Minor

Icon name and modifier mismatch (duplicate).

Same issue as line 583—using "rh-ui-error-fill" with pf-m-success for another "Ready" status. Should use "rh-ui-check-circle-fill" for consistency with success semantics.

🐛 Proposed fix
                  {{#> icon icon--modifier="pf-m-inline"}}
                    {{#> icon-content icon-content--modifier="pf-m-success"}}
-                    {{pfIcon "rh-ui-error-fill"}}
+                    {{pfIcon "rh-ui-check-circle-fill"}}
                    {{/icon-content}}
                  {{/icon}}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{#> icon icon--modifier="pf-m-inline"}}
{{#> icon-content icon-content--modifier="pf-m-success"}}
<i class="fas fa-exclamation-circle" aria-hidden="true"></i>
{{pfIcon "rh-ui-error-fill"}}
{{/icon-content}}
{{#> icon icon--modifier="pf-m-inline"}}
{{#> icon-content icon-content--modifier="pf-m-success"}}
{{pfIcon "rh-ui-check-circle-fill"}}
{{/icon-content}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/demos/Card/examples/Card.md` around lines 633 - 636, The icon
used for the success/Ready status is inconsistent: inside the block that uses
icon-content--modifier="pf-m-success" and the pfIcon helper (the
icon/icon-content pair rendering a "Ready" status), replace the pfIcon argument
"rh-ui-error-fill" with "rh-ui-check-circle-fill" so the icon name matches the
success modifier (look for the {{#> icon icon--modifier="pf-m-inline"}} / {{#>
icon-content icon-content--modifier="pf-m-success"}} block and the {{pfIcon
"rh-ui-error-fill"}} call).

@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 4f854a3 into patternfly:main Mar 13, 2026
6 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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.

Card: Token updates for unified theme

3 participants