Skip to content

feat(dual-list-selector): add high-contrast - #7686

Merged
mcoker merged 8 commits into
patternfly:high-contrast-q3from
srambach:7617-dual-list-hi-c
Aug 25, 2025
Merged

mcoker merged 8 commits into
patternfly:high-contrast-q3from
srambach:7617-dual-list-hi-c

Conversation

@srambach

@srambach srambach commented Jul 24, 2025 •

Copy link
Copy Markdown
Member

Fixes #7617
Figma design: https://www.figma.com/design/wKcOq7IrzfL1gEK2mocd6r/Semantic-dimension-border-width----font-weight-adjustment-test?node-id=10994-57326&t=r888cXH4fIPuJcgE-4

Top/bottom 1px border on hover (along with background change)
Top/bottom 2px border for selected items UNLESS there's a checkbox
Moves outline on the container out 2px so that the focus outline is not covered by the item's background. Question - use a spacer here or hard-coded pixels? It's not really a logical number.
Changes :focus to :focus-visible because the current implementation leaves a background hanging around if you click something to UNselect it and then move the mouse away.

Note: the border width of list items changes when selected, so we still need to use the pseudoelement

Assisted by Cursor autocomplete

@patternfly-build

patternfly-build commented Jul 24, 2025 •

Copy link
Copy Markdown
Collaborator

@srambach
srambach requested review from lboehling and mcoker July 24, 2025 20:27
@srambach srambach linked an issue Jul 28, 2025 that may be closed by this pull request

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

Comment on lines +65 to +66
--#{$dual-list-selector}__list-item-row--m-selected--BorderWidth: var(--pf-t--global--border--width--strong);
--#{$dual-list-selector}__list-item-row--m-selected--BorderColor: var(--pf-t--global--border--color--high-contrast);

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.

Not sure you need this if it's already defined?

Suggested change
--#{$dual-list-selector}__list-item-row--m-selected--BorderWidth: var(--pf-t--global--border--width--strong);
--#{$dual-list-selector}__list-item-row--m-selected--BorderColor: var(--pf-t--global--border--color--high-contrast);
--#{$dual-list-selector}__list-item-row--m-selected--BorderWidth: var(--pf-t--global--border--width--strong);

Comment on lines +60 to +61
--#{$dual-list-selector}__list-item-row--BorderWidth: var(--pf-t--global--border--width--regular);
--#{$dual-list-selector}__list-item-row--BorderColor: transparent;

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.

Can we update this so the border-width is what enables the border?

Suggested change
--#{$dual-list-selector}__list-item-row--BorderWidth: var(--pf-t--global--border--width--regular);
--#{$dual-list-selector}__list-item-row--BorderColor: transparent;
--#{$dual-list-selector}__list-item-row--BorderWidth: 0;
--#{$dual-list-selector}__list-item-row--BorderColor: var(--pf-t--global--border--color--high-contrast);

--#{$dual-list-selector}__list-item-row--BorderWidth: var(--pf-t--global--border--width--regular);
--#{$dual-list-selector}__list-item-row--BorderColor: transparent;
--#{$dual-list-selector}__list-item-row--hover--BackgroundColor: var(--pf-t--global--background--color--primary--hover);
--#{$dual-list-selector}__list-item-row--hover--BorderColor: var(--pf-t--global--border--color--high-contrast);

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.

Suggested change
--#{$dual-list-selector}__list-item-row--hover--BorderColor: var(--pf-t--global--border--color--high-contrast);
--#{$dual-list-selector}__list-item-row--hover--BorderWidth: var(--pf-t--global--border--width--regular);

Comment thread src/patternfly/components/DualListSelector/dual-list-selector.scss
&:focus {
&:focus-visible {
--#{$dual-list-selector}__list-item-row--BackgroundColor: var(--#{$dual-list-selector}__list-item-row--hover--BackgroundColor);
--#{$dual-list-selector}__list-item-row--BorderColor: var(--#{$dual-list-selector}__list-item-row--BorderColor);

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.

These are the same var?

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.

Just keeping you on your toes.

Comment thread src/patternfly/components/DualListSelector/dual-list-selector.scss
@srambach
srambach force-pushed the 7617-dual-list-hi-c branch from 6a24bfb to 01757e1 Compare August 15, 2025 14:47

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

Just a few places we can use the action--plain border tokens.

Comment thread src/patternfly/components/DualListSelector/dual-list-selector.scss Outdated
Comment thread src/patternfly/components/DualListSelector/dual-list-selector.scss Outdated
Comment thread src/patternfly/components/DualListSelector/dual-list-selector.scss Outdated
@mcoker
mcoker force-pushed the 7617-dual-list-hi-c branch from 1299fca to 691ed46 Compare August 21, 2025 23:15
@mcoker

mcoker commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

Looks like this branch may have been branched from the first commit in https://github.com/srambach/patternfly/tree/7616-drawer-hi-c for #7683. Rebased and dropped the 1st and 4th commits below since they were drawer changes. After the rebase, it exposed that we were including empty "count" badges in all items, so put those in a conditional.

Commits before
Screenshot 2025-08-21 at 6 04 05 PM

After
Screenshot 2025-08-21 at 6 20 03 PM

@mcoker

mcoker commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

@srambach do you mind giving this a once over and make sure it looks like you expect?

@srambach srambach left a comment

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.

@mcoker Looks good, thanks for fixing my branch mistake.

@mcoker
mcoker merged commit 9bc2d94 into patternfly:high-contrast-q3 Aug 25, 2025
4 checks passed
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.

High contrast borders - Dual list selector

4 participants