-
Notifications
You must be signed in to change notification settings - Fork 860
[EuiForm] Increase Contrast on EuiForm Section Controls to Pass WCAG AA Standards
#6729
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
Changes from all commits
37ff60a
cd59308
670df8d
c93ea40
74af05b
40957db
a528e8b
48ed465
27961fa
ab65814
2a960c6
e442597
68b4596
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 |
|---|---|---|
|
|
@@ -2,6 +2,9 @@ | |
| // stylelint-disable max-nesting-depth | ||
|
|
||
| .euiSwitch { | ||
| $euiSwitchOffDisabledColor: lightOrDarkTheme(transparentize($euiColorLightShade, .5), transparentize($euiColorDarkShade, .4)); | ||
| $euiSwitchDisabledThumbColor: lightOrDarkTheme(transparentize($euiColorDarkShade, .5), $euiColorDarkShade); | ||
|
|
||
|
Comment on lines
+5
to
+7
Contributor
Author
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. @cee-chen instead of adding these in the
Contributor
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. All good! As long as they're scoped to a selector, they're not available globally 👍 |
||
| position: relative; | ||
| display: inline-flex; | ||
| align-items: flex-start; | ||
|
|
@@ -24,30 +27,6 @@ | |
| @include euiCustomControlFocused; | ||
| } | ||
|
|
||
| &:disabled { | ||
| &:hover, | ||
| ~ .euiSwitch__label:hover { | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| .euiSwitch__body { | ||
| background-color: $euiSwitchOffColor; | ||
| } | ||
|
|
||
| .euiSwitch__thumb { | ||
| @include euiCustomControlDisabled; | ||
| background-color: $euiSwitchOffColor; | ||
| } | ||
|
|
||
| .euiSwitch__icon { | ||
| fill: $euiFormCustomControlDisabledIconColor; | ||
| } | ||
|
|
||
| + .euiSwitch__label { | ||
| color: $euiFormControlDisabledColor; | ||
| } | ||
| } | ||
|
|
||
| &[aria-checked='false'] { | ||
| .euiSwitch__body { | ||
| background-color: $euiSwitchOffColor; | ||
|
|
@@ -67,6 +46,31 @@ | |
| } | ||
| } | ||
| } | ||
|
|
||
| &:disabled { | ||
| &:hover, | ||
| ~ .euiSwitch__label:hover { | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| .euiSwitch__body { | ||
| background-color: $euiSwitchOffDisabledColor; | ||
| } | ||
|
|
||
| .euiSwitch__thumb { | ||
| background-color: rgba(0,0,0,0); | ||
| border-color: $euiSwitchDisabledThumbColor; | ||
| box-shadow: none; | ||
| } | ||
|
|
||
| .euiSwitch__icon { | ||
| fill: $euiColorDarkShade; | ||
| } | ||
|
|
||
| + .euiSwitch__label { | ||
| color: $euiFormControlDisabledColor; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .euiSwitch__body { | ||
|
|
@@ -107,7 +111,7 @@ | |
| width: $euiSwitchWidth - ($euiSwitchThumbSize / 2) + $euiSizeS; | ||
| height: $euiSwitchIconHeight; | ||
| transition: left $euiAnimSpeedNormal $euiAnimSlightBounce, right $euiAnimSpeedNormal $euiAnimSlightBounce; | ||
| fill: $euiTextColor; | ||
| fill: $euiColorEmptyShade; | ||
| } | ||
|
|
||
| .euiSwitch__icon--checked { | ||
|
|
@@ -194,7 +198,7 @@ | |
| .euiSwitch__button[aria-checked='false'], | ||
| .euiSwitch__button[aria-checked='true']:disabled { | ||
| .euiSwitch__thumb { | ||
| border-color: $euiFormCustomControlBorderColor; | ||
| border-color: $euiSwitchDisabledThumbColor; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Improved the contrast ratio of `EuiCheckbox`, `EuiRadio`, and `EuiSwitch` in their unchecked states to meet WCAG AA guidelines. |
Uh oh!
There was an error while loading. Please reload this page.