fix(drawer): restyle the splitter - #8198
Conversation
WalkthroughThe Drawer splitter styling has been updated with new rounded variant support. Changes include modified splitter dimensions, introduction of new focus and hover states for splitter pseudo-elements, updated handle styling with border radius, expansion of responsive behavior for pill and panel-bottom variants, and multiple new CSS variables mapping state-specific colors and insets. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
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. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
Preview: https://pf-pr-8198.surge.sh A11y report: https://pf-pr-8198-a11y.surge.sh |
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/Drawer/drawer.scss`:
- Around line 590-594: The :active state currently maps
--#{$drawer}__splitter--after--BorderColor to the focus token; update the
&:active rule so it uses the active border token instead of the focus token
(i.e., map --#{$drawer}__splitter--after--BorderColor to
--#{$drawer}__splitter--active--after--BorderColor) so the
--...active--after--BorderColor token (defined earlier) is actually consumed;
adjust only the &:active mapping in the block containing
--#{$drawer}__splitter-handle--after--BackgroundColor and
--#{$drawer}__splitter--after--BorderColor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6d3bf496-7649-4210-b81a-b16fd7fa2dd9
📒 Files selected for processing (1)
src/patternfly/components/Drawer/drawer.scss
| &:focus, | ||
| &:active { | ||
| --#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor); | ||
| --#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--focus--after--BorderColor); | ||
| } |
There was a problem hiding this comment.
Use the active border token in :active state (currently wired to focus).
Line 593 sets :active to --...focus--after--BorderColor, so --...active--after--BorderColor (mapped at Line 333) is never consumed.
Proposed fix
- &:focus,
- &:active {
+ &:focus {
--#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor);
--#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--focus--after--BorderColor);
}
+
+ &:active {
+ --#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor);
+ --#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--active--after--BorderColor, var(--#{$drawer}__splitter--focus--after--BorderColor));
+ }📝 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.
| &:focus, | |
| &:active { | |
| --#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor); | |
| --#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--focus--after--BorderColor); | |
| } | |
| &:focus { | |
| --#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor); | |
| --#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--focus--after--BorderColor); | |
| } | |
| &:active { | |
| --#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor); | |
| --#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--active--after--BorderColor, var(--#{$drawer}__splitter--focus--after--BorderColor)); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/patternfly/components/Drawer/drawer.scss` around lines 590 - 594, The
:active state currently maps --#{$drawer}__splitter--after--BorderColor to the
focus token; update the &:active rule so it uses the active border token instead
of the focus token (i.e., map --#{$drawer}__splitter--after--BorderColor to
--#{$drawer}__splitter--active--after--BorderColor) so the
--...active--after--BorderColor token (defined earlier) is actually consumed;
adjust only the &:active mapping in the block containing
--#{$drawer}__splitter-handle--after--BackgroundColor and
--#{$drawer}__splitter--after--BorderColor.
There was a problem hiding this comment.
@srambach, you're right — I've re-examined the token definitions more carefully. The active and focus border/background tokens resolve to the same underlying design token values:
| Token | Value |
|---|---|
--splitter--focus--after--BorderColor |
var(--pf-t--global--border--color--control--default) |
--splitter--active--after--BorderColor |
var(--pf-t--global--border--color--control--default) |
--splitter-handle--focus--after--BackgroundColor |
var(--pf-t--global--border--color--clicked) |
--splitter-handle--active--after--BackgroundColor |
var(--pf-t--global--border--color--clicked) |
The same holds for the pill variants — focus and active both map to clicked. Grouping :focus, :active together is intentional and produces the correct visual output. My original comment was incorrect — there's no issue here. Apologies for the noise!
🧠 Learnings used
Learnt from: srambach
Repo: patternfly/patternfly PR: 8030
File: src/patternfly/components/TreeView/tree-view.scss:441-445
Timestamp: 2025-12-17T15:25:08.994Z
Learning: In PatternFly TreeView component (src/patternfly/components/TreeView/tree-view.scss), the `.pf-m-disabled` modifier on list items affects only the visual appearance of node content (text and icons), but intentionally does not change the toggle button color. The toggle remains functional and visually distinct to indicate the item can still be expanded/collapsed.
f59da5f to
2da6bd3
Compare
kaylachumley
left a comment
There was a problem hiding this comment.
Leaving the token updates here per our compass sync conversation!
Handle on default: global/border/color/control/default
Handle and Splitter line on Hover: global/border/color/hover
Handle and splitter line on active/clicked: global/border/color/clicked
|
|
||
| // Splitter border | ||
| --#{$drawer}__splitter--after--BorderColor: var(--pf-t--global--border--color--default); | ||
| --#{$drawer}__splitter--after--BorderColor: var(--pf-t--global--border--color--control--default); |
There was a problem hiding this comment.
Hey! One last update here: Can you please update the splitter border to use global/border/color/default
There was a problem hiding this comment.
looks like this update would also apply to code lines 132, 133 and 134
| --#{$drawer}--m-pill--m-panel-bottom__splitter--MarginInlineStart: var(--#{$drawer}--m-pill__panel--BorderRadius); | ||
| --#{$drawer}--m-pill--m-panel-bottom__splitter--after--Width: auto; | ||
| --#{$drawer}--m-pill--m-panel-bottom__splitter--after--Height: #{pf-size-prem(1px)}; | ||
| --#{$drawer}--m-pill--m-panel-bottom__splitter--after--BorderBlockStartWidth: var(--#{$drawer}__splitter--after--border-width--base); |
There was a problem hiding this comment.
the vertical splitter line on hover/focus in the resizable pill drawer looks like its 2px thick since its the 2 lines squashed together -- any way we can add a calc here to divide the border width in half so it appears as a 1px line?
mcoker
left a comment
There was a problem hiding this comment.
LGTM! Just a couple of comments from the group review.
| border-block-end-width: var(--#{$drawer}__splitter--after--BorderBlockEndWidth); | ||
| border-inline-start-width: var(--#{$drawer}__splitter--after--BorderInlineStartWidth); | ||
| border-inline-end-width: var(--#{$drawer}__splitter--after--BorderInlineEndWidth); | ||
| transform: var(--#{$drawer}__splitter--after--Transform, none); |
There was a problem hiding this comment.
Nit but I'd update this to use the individual property for whatever function(s) that are passed
| transform: var(--#{$drawer}__splitter--after--Transform, none); | |
| translate: var(--#{$drawer}__splitter--after--Translate, none); |
| --#{$drawer}__splitter-handle--InsetInlineStart: 50%; | ||
| --#{$drawer}--m-panel-left__splitter-handle--InsetInlineStart: 50%; | ||
| --#{$drawer}--m-panel-bottom__splitter-handle--InsetBlockStart: calc(50% - var(--#{$drawer}__splitter--after--border-width--base)); | ||
| --#{$drawer}--m-panel-bottom__splitter-handle--InsetBlockStart: 50%; // calc(50% - var(--#{$drawer}__splitter--after--border-width--base)); |
There was a problem hiding this comment.
just a reminder to remove this
| --#{$drawer}--m-panel-bottom__splitter-handle--InsetBlockStart: 50%; // calc(50% - var(--#{$drawer}__splitter--after--border-width--base)); | |
| --#{$drawer}--m-panel-bottom__splitter-handle--InsetBlockStart: 50%; |
|
🎉 This PR is included in version 6.5.0-prerelease.61 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #8164
Figma: https://www.figma.com/design/qRn3S225WwGHIdgGZX0LTC/Unified-Theme--Design-Tokens--Styles---Specs?node-id=10328-3938&m=dev
Summary by CodeRabbit