Skip to content

feat(Accordion): unified theme updates#8217

Closed
kmcfaul wants to merge 4 commits into
patternfly:mainfrom
kmcfaul:8079-unified-accordion
Closed

feat(Accordion): unified theme updates#8217
kmcfaul wants to merge 4 commits into
patternfly:mainfrom
kmcfaul:8079-unified-accordion

Conversation

@kmcfaul

@kmcfaul kmcfaul commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Closes #8079

Summary:

  • Separated the toggle background color from the expandable content/before background color
  • Updated expandable content background color to match overall accordion background color (see comment)
  • Updated expandable content margin to match Figma & removed expandable content body padding (was previously split due to differing background colors)
  • Updated expanded toggle padding to be uniform for large variant
  • Updated hover toggle styling to not apply when item is expanded (clicked styling should take precedence)
  • Removed visible margin on expandable content when hidden
  • Added toggle border width for expanded items (HC)
  • Removed expandable content border (HC)

Summary by CodeRabbit

  • Style
    • Accordion root now uses a transparent background and clearer expanded-item visuals.
    • Improved expanded-state toggle visuals (background, border and spacing) for consistent appearance.
    • Harmonized spacing and responsive margins for expandable content; adjusted large-display toggle padding.
    • Hover/focus effects limited to non-expanded items for clearer interactions.
    • Smoother expand/collapse timing and transitions; removed extra body padding for cleaner layout.

@kmcfaul kmcfaul requested a review from mcoker March 12, 2026 16:12
@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 9b85fa24-140b-4598-8de9-bb272c2e62ad

📥 Commits

Reviewing files that changed from the base of the PR and between d339f7b and e9950f5.

📒 Files selected for processing (1)
  • src/patternfly/components/Accordion/accordion.scss

Walkthrough

Added and remapped accordion CSS custom properties: new expanded-state toggle/background/border tokens, updated expandable-content spacing/background/transitions, display-lg padding tweak, narrowed hover/focus scope, and removal of some exported expandable-content-body padding tokens. Root and expandable-content backgrounds set to transparent.

Changes

Cohort / File(s) Summary
Accordion Styling & Theme Tokens
src/patternfly/components/Accordion/accordion.scss
Added exported m-expanded toggle/background/border tokens and new expandable-content spacing/background tokens; changed root and expandable-content default backgrounds to transparent; propagated m-expanded tokens to base toggle; adjusted display-lg padding; updated expandable-content margins and transitions; removed some expandable-content-body public padding tokens; limited hover/focus rules to non-expanded items.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Suggested labels

released on @prerelease``, Needs design review

Suggested reviewers

  • mcoker
🚥 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 PR title 'feat(Accordion): unified theme updates' follows conventional commit format with proper scope and descriptive subject.
Linked Issues check ✅ Passed The PR successfully implements all coding-related objectives from #8079: separated toggle/content backgrounds, updated expandable content background, adjusted margins/padding to match specs, made large variant padding uniform, and prevented hover from overriding expanded state.
Out of Scope Changes check ✅ Passed All changes in accordion.scss are directly aligned with #8079 objectives including token updates, background color changes, margin/padding adjustments, and border-width additions for HC mode.

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

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@kmcfaul kmcfaul requested a review from kaylachumley March 12, 2026 16:12
Comment thread src/patternfly/components/Accordion/accordion.scss
@patternfly-build

patternfly-build commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Comment thread src/patternfly/components/Accordion/accordion.scss Outdated

@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/Accordion/accordion.scss (1)

251-262: Consider adding margin-block-start to transition-property.

The hidden state now resets margin-block-start to 0 (line 252), and the visible state uses the token value (line 262). However, line 274's transition-property only includes margin-block-end, not margin-block-start. If smooth animated transitions for the top margin are intended, consider adding margin-block-start to the transition properties.

If the instant change is intentional (e.g., to prevent visual artifacts during expand/collapse), this is fine as-is.

♻️ Optional: Add margin-block-start to transitions
-  transition-property: opacity, translate, visibility, max-height, margin-block-end;
+  transition-property: opacity, translate, visibility, max-height, margin-block-start, margin-block-end;

Note: You'd also need to add corresponding delay and duration values.

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

In `@src/patternfly/components/Accordion/accordion.scss` around lines 251 - 262,
The transition currently only includes margin-block-end but the hidden state
resets --#{$accordion}__expandable-content--MarginBlockStart while the visible
state uses it, so update the transition-property on
.#{$accordion}__expandable-content to include margin-block-start (alongside
margin-block-end) and ensure you add corresponding transition-duration/-delay
tokens or values consistent with the existing transition for margin-block-end;
target the CSS selector .#{$accordion}__expandable-content (and the hidden
selector .#{$accordion}__expandable-content:where([hidden])) and reference the
token --#{$accordion}__expandable-content--MarginBlockStart when adding the
transition so top-margin changes animate smoothly.
🤖 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/Accordion/accordion.scss`:
- Around line 251-262: The transition currently only includes margin-block-end
but the hidden state resets
--#{$accordion}__expandable-content--MarginBlockStart while the visible state
uses it, so update the transition-property on .#{$accordion}__expandable-content
to include margin-block-start (alongside margin-block-end) and ensure you add
corresponding transition-duration/-delay tokens or values consistent with the
existing transition for margin-block-end; target the CSS selector
.#{$accordion}__expandable-content (and the hidden selector
.#{$accordion}__expandable-content:where([hidden])) and reference the token
--#{$accordion}__expandable-content--MarginBlockStart when adding the transition
so top-margin changes animate smoothly.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: a234ecbb-408e-4143-aa0e-fe49acd27c7f

📥 Commits

Reviewing files that changed from the base of the PR and between 23cb693 and 6bd0af5.

📒 Files selected for processing (1)
  • src/patternfly/components/Accordion/accordion.scss

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

♻️ Duplicate comments (1)
src/patternfly/components/Accordion/accordion.scss (1)

11-11: ⚠️ Potential issue | 🟠 Major

Preserve backward compatibility for the legacy expanded background token.

--#{$accordion}__item--m-expanded--BackgroundColor is still exported on Line 11, but it no longer drives rendered styles after this refactor. That can silently break existing downstream overrides that still set this public token. Please alias the new expanded-toggle token to the legacy one until the breaking-change window.

Suggested compatibility-safe mapping
-  --#{$accordion}__item--m-expanded__toggle--BackgroundColor: var(--pf-t--global--background--color--action--plain--clicked);
+  --#{$accordion}__item--m-expanded__toggle--BackgroundColor: var(--#{$accordion}__item--m-expanded--BackgroundColor);

Also applies to: 21-21, 234-234

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

In `@src/patternfly/components/Accordion/accordion.scss` at line 11, The legacy
token --#{$accordion}__item--m-expanded--BackgroundColor is still exported but
no longer drives rendered styles; reintroduce a compatibility alias by assigning
that legacy custom property to the new expanded-toggle token value (i.e. set
--#{$accordion}__item--m-expanded--BackgroundColor:
var(--#{$accordion}__item--<expanded-toggle-token-name>--BackgroundColor)) so
downstream overrides continue to work, and apply the same aliasing approach for
the other affected legacy tokens referenced in the diff (ensure you update the
corresponding token names where the new expanded-toggle token is used).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/patternfly/components/Accordion/accordion.scss`:
- Line 11: The legacy token --#{$accordion}__item--m-expanded--BackgroundColor
is still exported but no longer drives rendered styles; reintroduce a
compatibility alias by assigning that legacy custom property to the new
expanded-toggle token value (i.e. set
--#{$accordion}__item--m-expanded--BackgroundColor:
var(--#{$accordion}__item--<expanded-toggle-token-name>--BackgroundColor)) so
downstream overrides continue to work, and apply the same aliasing approach for
the other affected legacy tokens referenced in the diff (ensure you update the
corresponding token names where the new expanded-toggle token is used).

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 774e6975-d05e-470f-92c2-56ae658cefe7

📥 Commits

Reviewing files that changed from the base of the PR and between 26be31d and d339f7b.

📒 Files selected for processing (1)
  • src/patternfly/components/Accordion/accordion.scss

@mcoker

mcoker commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

After chatting with @lboehling and @andrew-ronaldson, going to close this in favor of what was included in the glass work where the original accordion designs are preserved in non-glass theme, and glass will apply plain styles.

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.

Accordions - Unified Theme Updates (Core)

4 participants