-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Added focus ring for focus visible #37700
Changes from 2 commits
15e3a88
f303d56
cb448a0
429e7b1
19e0258
897ed4f
cbf6b75
91a4e73
99f4306
bbed9e0
04ccdf8
cbf01c3
0707ddd
0b4601e
bd47af2
bf0ef8e
b5595de
4db67f4
f0ed3ff
4f67900
60f67c5
e7483f4
be0c6b4
2597087
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,9 +239,9 @@ | |
/* --ads-v2-color-outline: var(--ads-v2-color-blue-300); | ||
--ads-v2-border-width-outline: 2px; */ | ||
/* TODO: fix focus issue across the platform */ | ||
--ads-v2-color-outline: transparent; | ||
--ads-v2-border-width-outline: 0; | ||
--ads-v2-offset-outline: 0; | ||
--ads-v2-color-outline: var(--ads-v2-color-blue-300); | ||
--ads-v2-border-width-outline: 2px; | ||
--ads-v2-offset-outline: -2px; | ||
|
||
/** | ||
* ===========================================* | ||
|
@@ -252,9 +252,10 @@ | |
} | ||
|
||
/* react-aria useFocusRing helper class*/ | ||
.ads-v2-focus-ring { | ||
outline: var(--ads-v2-border-width-outline) solid var(--ads-v2-color-outline); | ||
outline-offset: var(--ads-v2-offset-outline); | ||
.ads-v2-focus-ring, | ||
:focus-visible { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know exactly where we should apply styles? Can we use more specific selectors? |
||
outline: var(--ads-v2-border-width-outline) solid var(--ads-v2-color-outline) !important; | ||
outline-offset: var(--ads-v2-offset-outline) !important; | ||
} | ||
|
||
/* Placeholder color */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,23 +22,6 @@ body.dragging * { | |
cursor: grabbing !important; | ||
} | ||
|
||
/** | ||
Disable outline completely from all components | ||
*/ | ||
:focus, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsartisan You have to see this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we cant escape till we remove blueprint components component. This is done because of blueprint CSS from what I know. |
||
:focus-visible { | ||
outline: none !important; | ||
outline-offset: 0 !important; | ||
} | ||
|
||
/** | ||
Disable outline for adsv2 select component | ||
*/ | ||
.ads-v2-select.rc-select-focused { | ||
outline: none !important; | ||
outline-offset: 0 !important; | ||
} | ||
|
||
#root.overlay { | ||
opacity: 0; | ||
pointer-events: none; | ||
|
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.
💡 Codebase verification
Focus ring contrast needs improvement
The current focus ring uses
--ads-v2-color-blue-300: #8bb0fa
which may not provide sufficient contrast against light backgrounds like#fff
used in the Select component. Consider using a darker blue shade (e.g.,--ads-v2-color-blue-600: #2d6bf4
) for better accessibility compliance.app/client/packages/design-system/ads/src/__theme__/default/index.css
: Update--ads-v2-color-outline
to use a higher contrast colorapp/client/packages/design-system/ads/src/Select/rc-styles.css
: Multiple background colors (#fff, #ddd) need to be tested against the focus ring🔗 Analysis chain
Verify focus ring contrast ratio
Please ensure the focus ring color (var(--ads-v2-color-outline)) provides sufficient contrast against all possible background colors for accessibility compliance.
Also applies to: 115-117
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 2365
Script:
Length of output: 1031
Script:
Length of output: 1103
Script:
Length of output: 81