Skip to content

fix(drawer): restyle the splitter - #8198

Merged
mcoker merged 7 commits into
patternfly:mainfrom
srambach:3550-unified-drawer-splitter
Mar 30, 2026
Merged

mcoker merged 7 commits into
patternfly:mainfrom
srambach:3550-unified-drawer-splitter

Conversation

@srambach

@srambach srambach commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #8164
Figma: https://www.figma.com/design/qRn3S225WwGHIdgGZX0LTC/Unified-Theme--Design-Tokens--Styles---Specs?node-id=10328-3938&m=dev

Summary by CodeRabbit

  • Style
    • Updated drawer splitter visual appearance with refined dimensions and color styling
    • Enhanced splitter handle with improved focus and hover state indicators
    • Extended responsive styling support for pill and panel-bottom layout variants

@coderabbitai

coderabbitai Bot commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

Cohort / File(s) Summary
Drawer Splitter Styling
src/patternfly/components/Drawer/drawer.scss
Comprehensive splitter styling updates: increased height from 9px to 12px, introduced focus outline offset and multiple state-specific border/background color tokens, added border radius and updated pseudo-element (::after) handling with insets and transforms, expanded responsive variants for pill and panel-bottom modes, and added 20+ new CSS variables for state management across hover/focus/active states.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested labels

released on @prerelease``

Suggested reviewers

  • lboehling
  • andrew-ronaldson
  • 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 follows conventional commit format with 'fix' type prefix and clearly describes the main change to the drawer splitter.
Linked Issues check ✅ Passed The code changes implement the rounded variant for the drawer splitter as specified in issue #8164, introducing new border-radius tokens and updated styling for the splitter handle.
Out of Scope Changes check ✅ Passed All changes are focused on the drawer splitter component styling and align with the objective of implementing a new rounded variant without unrelated modifications.

✏️ 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).
Share your feedback on Discord.


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.

@patternfly-build

patternfly-build commented Mar 4, 2026 •

Copy link
Copy Markdown
Collaborator

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa2a6f8 and f59da5f.

📒 Files selected for processing (1)
  • src/patternfly/components/Drawer/drawer.scss

Comment on lines 590 to 594
&:focus,
&:active {
--#{$drawer}__splitter-handle--after--BackgroundColor: var(--#{$drawer}__splitter-handle--focus--after--BackgroundColor);
--#{$drawer}__splitter--after--BorderColor: var(--#{$drawer}__splitter--focus--after--BorderColor);
}

@coderabbitai coderabbitai Bot Mar 4, 2026 •

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.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
&: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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai can you check again?

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.

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

@kaylachumley kaylachumley left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@srambach srambach linked an issue Mar 9, 2026 that may be closed by this pull request

// 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! One last update here: Can you please update the splitter border to use global/border/color/default

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this update would also apply to code lines 132, 133 and 134

@srambach
srambach requested a review from kaylachumley March 9, 2026 19:32
--#{$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);

@lboehling lboehling Mar 18, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@srambach
srambach requested a review from lboehling March 24, 2026 20:00

@andrew-ronaldson andrew-ronaldson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool beans

@kaylachumley
kaylachumley self-requested a review March 25, 2026 14:05

@lboehling lboehling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@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! 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);

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.

Nit but I'd update this to use the individual property for whatever function(s) that are passed

Suggested change
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));

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.

just a reminder to remove this

Suggested change
--#{$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%;

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

👨‍🎨🎨

@mcoker
mcoker merged commit 952ce5b into patternfly:main Mar 30, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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.

Drawer splitter: New rounded variant Drawer splitter - Update drag handle design on resizable drawer Drawers - update tokens and add Pill variant

6 participants