-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(components): use new focus styles for interactive elements #1548
Conversation
72b431c
to
7d037a7
Compare
I see some of the things that don't match. I've set the yellow background to be able to test it properly. BreadcrumbsMissing focus state on Anchors in Breadcrumbs. Danger buttonsButtons with Split buttonsInset focus on Split buttons should match the button AnchorsExpected: ChromeExpected: Skip linksRemove underline for focused Skip links. MultiselectFocused Multiselect is showing two focus states. Only the outer one should be visible (same as now). Expected: SelectOnly the border change is visible with focus. Expected: TagTags should have a Storybook: Expected: I will do another pass after everything is implemented. |
68ca802
to
9ae27ca
Compare
Thanks for the feedback @lucijanblagonic !
A few of the items that include the |
@jzempel (RE: sub nav header item color) I believe the |
No you are spot on @lucijanblagonic, this was something I observed as well. It should be fixed now! |
packages/notifications/src/styled/global-alert/StyledGlobalAlert.ts
Outdated
Show resolved
Hide resolved
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.
Since my previous review runs counter to #1548 (review), I'm going to mark this approved and leave final design finesse to @lucijanblagonic. Nice work, @Francois-Esquire.
heya, another nit relating to animation, for button group, looks like the selected button focus doesn't have a transition. also for split button, when set to nit for text area, a very edge case, when focus is set to inset, i would imagine the focus ring would sit over the resize grip? noticed the subnav thing as well, but looks like that'll be resolved as a separate bug. other than that this looks great! thanks @Francois-Esquire!! |
Thanks for the feedback @steue ! I've corrected the For the |
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.
LGTM! 😍
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.
Other than remaining feedback, everything looks good.
setIsFocused(true); | ||
} | ||
}, 0); | ||
}; |
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.
I don't know Garden's tolerance for this so maybe I'm just being paranoid, but setTimeout will make this code effectively non-deterministic without jest timer mocks. It may not be clear to consumers in tests I guess. But if that's a non-issue / we don't want them to be testing this logic then disregard my concern :)
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.
I think this may be a warp in git history 👽 because this was the original code within the Accordion.Header
component being restored after it was removed early in this PR. Currently we don't modify this file at all, however this is something we can talk more about. Come to think of it, there is history I am unaware of of why we implemented in this fashion.
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.
awesome @Francois-Esquire ! this looks great! ✨
Description
This PR introduces new focus ring styling using the
focusStyles
utility.Detail
Interactive components throughout the component library have been updated with the new focus ring.
Notable changes
sweeping changes and additions
focus with
outline
vsbox-shadow
While most components use the conventional
box-shadow
focus ring, there are some exceptions:Anchor
:outline
was used to better visualize wrapping anchor text when encountering a line break.NavItem
:outline
worked with the transparent styling within the componentfocusing within
We want to move components away from the
isFocused
prop in favor of modern CSS focus selectors (eg:focus-within
) where possible. TheTiles.Tile
component was updated with that in mind. This was made possible with the:focus-within
CSS selector to allow these wrapping components to display focus when their children receive it.Other components that were not affected:
Accordion.Header
::focus-within
is being used, howeverisFocused
is needed due to nested interactive elements.FauxInput
: due toisFocused
being a public API, the prop was not removed, however:focus-within
is used.components not using the
focusStyles
utilitycolorpickers
color rangeforms
Range
componentExamples:
Accordion
Forms
text Input
Checklist
yarn start
)renders as expected with reversed (RTL) direction?bedrock
)