feat(card): update card to use unified theme tokens#8219
Conversation
…ng-sullyman/patternfly into card-unified-theme-token-updates
WalkthroughUpdates 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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. 📝 Coding Plan
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 Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
|
Preview: https://pf-pr-8219.surge.sh A11y report: https://pf-pr-8219-a11y.surge.sh |
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
src/patternfly/components/Card/card.scsssrc/patternfly/demos/Card/card-template-gallery.hbssrc/patternfly/demos/Card/examples/Card.mdsrc/patternfly/demos/Card/templates/card-demo--popover-table.hbssrc/patternfly/demos/Card/templates/card-demo--status-card.hbssrc/patternfly/demos/Card/templates/card-demo--template-gallery.hbssrc/patternfly/demos/Card/templates/card-template-data-list.hbssrc/patternfly/demos/Card/templates/card-template-events.hbssrc/patternfly/demos/Card/templates/card-template-expandable-status-card.hbssrc/patternfly/demos/Card/templates/card-template-expandable-status.hbssrc/patternfly/demos/Card/templates/card-template-status.hbs
| {{#> 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}} |
There was a problem hiding this comment.
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.
| {{#> 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}} |
There was a problem hiding this comment.
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.
| {{#> 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).
|
🎉 This PR is included in version 6.5.0-prerelease.53 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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