-
Notifications
You must be signed in to change notification settings - Fork 6.8k
stepper(guide): example inaccessible in dark mode #17152
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
Comments
@Splaktar , can I help in fixing this? |
@walvekarnikhil yes, that would be greatly appreciated! We should remove the hard coded CSS color overrides. Then instead of [class.example-active]="selectedIndex === i" We can probably do something like [color]="selectedIndex === i ? 'primary' : undefined" This would use the theme colors which will account for dark/light mode changes. |
@Splaktar , Please let me know if I am missing something here. Should we create a style which will work for both dark and light mode? |
Ah yes, that's a good point! They are native If we remove Line 18 in 84bfa7c
Chrome still applies the user agent stylesheet of color: -internal-light-dark-color(buttontext, rgb(170, 170, 170)); Which results in black text for both light and dark themes. If we change the color: inherit; Then the button picks up the theme color. Then for the active step, Lines 21 to 24 in 84bfa7c
could be changed to the following .example-step.example-active {
color: inherit;
border-bottom: 1px solid;
font-weight: 600;
} to pick up the theme's text color (for both the button text and inkbar border) and use Additionally, Lines 26 to 29 in 84bfa7c
needs to be updated to inherit the theme text color and override the user agent stylesheet: .example-nav-button {
background: transparent;
border: 0;
color: inherit;
} |
Thanks @Splaktar , |
LGTM, does it pass the Lighthouse a11y Audit? |
Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes angular#17152
@Splaktar , |
Ah yeah, there is no good way to test an example in this repo with the docs site at this time. I guess that we can take a look after this gets merged in. |
Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes angular#17152
Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes angular#17152
) * docs(stepper): Make CDK stepper example accessible in dark mode. Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes #17152 * Changing order of styles. * Triggering CircleCI build again. * Removing color inherit, since it is not required. It is still required for nav buttons, since those show in the black.
) * docs(stepper): Make CDK stepper example accessible in dark mode. Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes #17152 * Changing order of styles. * Triggering CircleCI build again. * Removing color inherit, since it is not required. It is still required for nav buttons, since those show in the black. (cherry picked from commit 5f76afa)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ular#20013) * docs(stepper): Make CDK stepper example accessible in dark mode. Removed hard-coded colors and replaced with inherit colors. Used font-weight to show active step. Fixes angular#17152 * Changing order of styles. * Triggering CircleCI build again. * Removing color inherit, since it is not required. It is still required for nav buttons, since those show in the black.
Documentation Feedback
The example in the "Creating a custom stepper using the CDK stepper" Guide doesn't display properly or meet WAI a11y standards. The step labels and arrows are unreadable.
Affected documentation page:
https://material.angular.io/guide/creating-a-custom-stepper-using-the-cdk-stepper
The text was updated successfully, but these errors were encountered: