Skip to content

feat(ToggleGroup): unified theme updates - #8154

Merged
mcoker merged 3 commits into
patternfly:mainfrom
kmcfaul:unified-toggle-group
Mar 4, 2026
Merged

feat(ToggleGroup): unified theme updates#8154
mcoker merged 3 commits into
patternfly:mainfrom
kmcfaul:unified-toggle-group

Conversation

@kmcfaul

@kmcfaul kmcfaul commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Closes #8059.

Updates for unified theme & docs update to use RH icons.

Need to open follow up bug for pre-existing border layer issue (hovering over a toggle group item whose left sibling is selected cuts into the selected border color).

Summary by CodeRabbit

  • Documentation

    • Updated toggle group examples to use the design-system icon helper for icons, preserving structure and accessibility while aligning examples with current standards.
  • Style

    • Overhauled toggle group styles: refined background, text and border colors; introduced explicit icon color tokens; improved hover, selected and disabled states, spacing, radii and adjacent-item edge-case behavior for more consistent interactive feedback.

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Replaces inline Font Awesome icon markup with pfIcon helper calls in ToggleGroup examples and updates ToggleGroup SCSS to use unified theme tokens and new icon color variables, adjusting hover/selected/disabled colors, borders, radii, and adjacent-item spacing/selectors.

Changes

Cohort / File(s) Summary
ToggleGroup Examples
src/patternfly/components/ToggleGroup/examples/toggle-group.md
Replaced static Font Awesome <i ...> icon markup with {{pfIcon 'rh-ui-*'}} helper calls inside toggle-group-icon blocks in "With icon" and "Icon-and-text" examples; markup structure and accessibility attributes preserved.
ToggleGroup Styling
src/patternfly/components/ToggleGroup/toggle-group.scss
Switched color tokens to control/brand variants; added icon color variables for normal/hover/selected/disabled; updated hover/selected/disabled border colors, background/text colors, radii, z-index and adjacent-item selector rules; moved icon color application into a dedicated .toggle-group__icon rule.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • mcoker
  • srambach
  • lboehling
🚥 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 clearly and accurately describes the main changes: unified theme updates to the ToggleGroup component following conventional commit format.
Linked Issues check ✅ Passed Code changes implement unified theme updates to ToggleGroup component and update documentation to use Red Hat icons, directly addressing requirements from issue #8059.
Out of Scope Changes check ✅ Passed All changes in the PR are directly scoped to ToggleGroup component theming updates and documentation icon replacements, with no unrelated modifications.

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

Actionable comments posted: 1

🤖 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/components/ToggleGroup/toggle-group.scss`:
- Around line 39-40: The selected state's ::before border width uses the
high-contrast token (--pf-t--global--border--width--high-contrast--regular)
which resolves to 0px in normal theme causing the selected ::before border to be
invisible; update the variable on the selected rule (the
--#{$toggle-group}__button--m-selected--before--BorderWidth declaration) to use
an always-visible token such as --pf-t--global--border--width--control--clicked
(matching the ::after forced-colors choice) and make the same replacement for
the related hover state variable so the ::before border is visible in normal
mode.

Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss
@patternfly-build

patternfly-build commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator

Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated

@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 other than the token @lboehling pointed out. Left a few nit comments 🤓

Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
Comment thread src/patternfly/components/ToggleGroup/toggle-group.scss Outdated
@coderabbitai
coderabbitai Bot requested review from lboehling and mcoker February 19, 2026 23:25

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

🤖 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/components/ToggleGroup/toggle-group.scss`:
- Around line 179-181: The adjacent-sibling selectors using
.#{$toggle-group}__icon+.#{$toggle-group}__text and
.#{$toggle-group}__text+.#{$toggle-group}__icon should be updated to include
spaces around the + for consistency and readability — locate the rules
referencing the #{$toggle-group}__icon and #{$toggle-group}__text selectors in
toggle-group.scss and change the selectors to use " .#{$toggle-group}__icon +
.#{$toggle-group}__text " and " .#{$toggle-group}__text +
.#{$toggle-group}__icon " (preserving the existing rule body/variables).

---

Duplicate comments:
In `@src/patternfly/components/ToggleGroup/toggle-group.scss`:
- Around line 39-42: The selected-button ::before border width uses the
high-contrast token (--pf-t--global--border--width--high-contrast--regular)
which resolves to 0px in normal mode causing ::before to be invisible; decide
whether ::before is intended only as a forced-colors overlay or should be
visible like ::after and act accordingly: either add a clear comment next to
--#{$toggle-group}__button--m-selected--before--BorderWidth (and mention
::before is only the high-contrast overlay and ::after carries the visible
selected border) or replace the token with an always-visible token (e.g.
--pf-t--global--border--width--control--clicked) so
--#{$toggle-group}__button--m-selected--before--BorderWidth renders in normal
mode; update the SCSS where
--#{$toggle-group}__button--m-selected--before--BorderWidth and
--#{$toggle-group}__button--m-selected--after--BorderWidth are defined to
reflect your choice.

Comment thread src/patternfly/components/ToggleGroup/toggle-group.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.

🤖 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/ToggleGroup/toggle-group.scss`:
- Around line 179-181: The adjacent-sibling selectors in toggle-group.scss are
missing required whitespace around the `+` combinator; update the two selectors
`.#{\$toggle-group}__icon+.#{\$toggle-group}__text` and
`.#{\$toggle-group}__text+.#{\$toggle-group}__icon` to include a space before
and after the `+` (i.e., change to `.#{\$toggle-group}__icon +
.#{\$toggle-group}__text` and `.#{\$toggle-group}__text +
.#{\$toggle-group}__icon`) so they conform to the project's CSS style
conventions.
- Around line 39-40: The selected-state ::before border is still using the
high-contrast 0px variable
(--pf-t--global--border--width--high-contrast--regular), which makes the
::before invisible in normal mode and nullifies the inline-start color fix;
update the selected ::before width variable
(--#{$toggle-group}__button--m-selected--before--BorderWidth) to a visible width
(e.g., use the control clicked width var
--pf-t--global--border--width--control--clicked or an explicit 2px) so that when
it is applied via --#{$toggle-group}__button--before--BorderWidth the ::before
ring becomes visible and the --before--BorderInlineStartColor override for
consecutive selected items takes effect. Ensure you only change the assignment
of --#{$toggle-group}__button--m-selected--before--BorderWidth (not the other
unrelated vars) so the rest of the rules that reference
--#{$toggle-group}__button--before--BorderWidth pick up the non-zero width.

@kmcfaul
kmcfaul force-pushed the unified-toggle-group branch from ccae828 to 776ee94 Compare March 4, 2026 20:30

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

LPTM!

@mcoker
mcoker merged commit 46a4f50 into patternfly:main Mar 4, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

The release is available on:

Your semantic-release bot 📦🚀

@lboehling

Copy link
Copy Markdown

this looks good to me btw!

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.

Toggle group - Unified theming updates (Core)

4 participants