-
Notifications
You must be signed in to change notification settings - Fork 171
fix: Use inset border for highlighting selected items in select and multiselect #3486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3486 +/- ##
========================================
Coverage 96.49% 96.49%
========================================
Files 804 804
Lines 23090 23090
Branches 7587 8000 +413
========================================
Hits 22281 22281
Misses 802 802
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
&.is-keyboard { | ||
border-color: awsui.$color-border-dropdown-item-focused; | ||
&:not(.visual-refresh) { | ||
box-shadow: inset 0 0 0 awsui.$border-control-focus-ring-shadow-spread awsui.$color-border-item-focused; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved this chunk up from below because it made more logical sense here.
@@ -80,8 +86,21 @@ | |||
border-end-end-radius: 0; | |||
} | |||
&.highlighted { | |||
border-color: awsui.$color-border-dropdown-item-hover; | |||
z-index: 3; | |||
border-color: awsui.$color-border-dropdown-item-selected; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hover/focus styling inside a selected item is displayed using an outline. So the border-color should remain the selected color.
c2319f4
to
52f7f88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in overall looks good. Did you try to run these changes in your dev pipeline?
@georgylobko Going through now, won't merge until they have! |
Description
A selectable item border has two states: selected (the item is selected - blue border), highlighted (the element is currently hovered over or navigated to - black/grey border). The trouble is that we don't have a 3:1 contrast between the two, so if you highlight a previously selected item, the difference in color isn't enough to be perceivable. And it's worth noting that both those colors should also have a 3:1 contrast against the background too.
There were no good options when Atsushi and I were playing around with colors, so instead, we decided to do a double outline approach. Two borders to communicate two states; they're still not 3:1 against each other, but they're both independently 3:1 against the background, and also results in a double-width border which is also perceivable (as long as it's at least 2px).
Related links, issue #, if available: AWSUI-60235
How has this been tested?
Screenshot testing. My pipeline's busy, will try to procure someone else's pipeline to send it through.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.