Skip to content

feat(card): update clickable/selectable plain card border styles - #8301

Merged
mcoker merged 1 commit into
patternfly:mainfrom
wise-king-sullyman:card-clickable-plain-card-design-updates
Apr 13, 2026
Merged

feat(card): update clickable/selectable plain card border styles#8301
mcoker merged 1 commit into
patternfly:mainfrom
wise-king-sullyman:card-clickable-plain-card-design-updates

Conversation

@wise-king-sullyman

@wise-king-sullyman wise-king-sullyman commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Closes #8142

Summary by CodeRabbit

  • Style
    • Enhanced card component styling to improve visual presentation when cards feature selectable or clickable interaction states, with refined border rendering.
    • Optimized styling for the current state on interactive cards, ensuring clearer and more consistent visual feedback for users regarding card status and interactivity.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Updated plain card styling to handle selectable and clickable variants. These variants now override the plain card's default border color and width tokens, while preserving plain's background and shadow behavior. Added special "current" state handling for combined selectable and clickable cards.

Changes

Cohort / File(s) Summary
Plain Card Styling
src/patternfly/components/Card/card.scss
Added overrides for .pf-m-selectable and .pf-m-clickable within plain cards to apply non-plain border styling. Introduced special handling for the .pf-m-current state to use combined selectable/clickable border tokens while maintaining plain card's background and shadow properties.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

released on @prerelease``

Suggested reviewers

  • lboehling
  • mcoker
  • 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 a type prefix (feat), scope (card), and a clear, descriptive summary of the changes made.
Linked Issues check ✅ Passed The PR changes directly address issue #8142's requirement that clickable plain cards behave like non-plain cards except for background color by updating border styles [#8142].
Out of Scope Changes check ✅ Passed The changes are limited to card.scss styling updates for clickable/selectable plain cards, staying within the scope defined by issue #8142.

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

276-279: Align pf-m-current token mapping with non-plain state split.

At Line 277-Line 278, clickable-only current state is using the combined selectable+clickable token. It works now, but it couples two distinct states and can regress if those tokens diverge later.

Suggested adjustment
     &.pf-m-selectable,
     &.pf-m-clickable {
       --#{$card}--BorderColor: var(--#{$card}--m-selectable--BorderColor);
       --#{$card}--BorderWidth: var(--#{$card}--m-selectable--BorderWidth);
-      
-      &.pf-m-current {
-        --#{$card}--BorderColor: var(--#{$card}--m-selectable--m-clickable--m-current--BorderColor);
-        --#{$card}--BorderWidth: var(--#{$card}--m-selectable--m-clickable--m-current--BorderWidth);
-      }
+    }
+
+    &.pf-m-clickable.pf-m-current {
+      --#{$card}--BorderColor: var(--#{$card}--m-clickable--m-current--BorderColor);
+      --#{$card}--BorderWidth: var(--#{$card}--m-clickable--m-current--BorderWidth);
+    }
+
+    &.pf-m-selectable.pf-m-clickable.pf-m-current {
+      --#{$card}--BorderColor: var(--#{$card}--m-selectable--m-clickable--m-current--BorderColor);
+      --#{$card}--BorderWidth: var(--#{$card}--m-selectable--m-clickable--m-current--BorderWidth);
     }
🤖 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 276 - 279, The
.pf-m-current block maps current-state variables to the combined
selectable+clickable tokens; update the mapping in the &.pf-m-current selector
to use the clickable-only current tokens instead (replace references to
--#{$card}--m-selectable--m-clickable--m-current--BorderColor/BorderWidth with
the clickable-only equivalents, e.g.,
--#{$card}--m-clickable--m-current--BorderColor and
--#{$card}--m-clickable--m-current--BorderWidth) so the current state for
clickable cards is not coupled to the selectable token path.
🤖 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 276-279: The .pf-m-current block maps current-state variables to
the combined selectable+clickable tokens; update the mapping in the
&.pf-m-current selector to use the clickable-only current tokens instead
(replace references to
--#{$card}--m-selectable--m-clickable--m-current--BorderColor/BorderWidth with
the clickable-only equivalents, e.g.,
--#{$card}--m-clickable--m-current--BorderColor and
--#{$card}--m-clickable--m-current--BorderWidth) so the current state for
clickable cards is not coupled to the selectable token path.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 8b920149-c52f-41b8-af3a-2a21be741d4c

📥 Commits

Reviewing files that changed from the base of the PR and between b480c6f and fb9ff09.

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

@patternfly-build

patternfly-build commented Apr 10, 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 8e414b8 into patternfly:main Apr 13, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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: Clickable plain card design updates

3 participants