feat(ToggleGroup): unified theme updates - #8154
Conversation
WalkthroughReplaces 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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.
|
Preview: https://pf-pr-8154.surge.sh A11y report: https://pf-pr-8154-a11y.surge.sh |
mcoker
left a comment
There was a problem hiding this comment.
LGTM other than the token @lboehling pointed out. Left a few nit comments 🤓
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🤖 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.
ccae828 to
776ee94
Compare
|
🎉 This PR is included in version 6.5.0-prerelease.50 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
this looks good to me btw! |
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
Style