Skip to content

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

Closed
Splaktar opened this issue Sep 20, 2019 · 9 comments · Fixed by #20013
Closed

stepper(guide): example inaccessible in dark mode #17152

Splaktar opened this issue Sep 20, 2019 · 9 comments · Fixed by #20013
Labels
Accessibility This issue is related to accessibility (a11y) area: material.angular.io area: material/stepper docs This issue is related to documentation good first issue This issue is a good place to start for first time contributors to the project help wanted The team would appreciate a PR from the community to address this issue P2 The issue is important to a large percentage of users, with a workaround

Comments

@Splaktar
Copy link
Contributor

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.

Screen Shot 2019-09-19 at 23 06 19
Screen Shot 2019-09-19 at 23 06 29

Affected documentation page:
https://material.angular.io/guide/creating-a-custom-stepper-using-the-cdk-stepper

@Splaktar Splaktar added the docs This issue is related to documentation label Sep 20, 2019
@Splaktar Splaktar changed the title stepper: stepper(guide): example inaccessible in dark mode Sep 20, 2019
@Splaktar Splaktar added the Accessibility This issue is related to accessibility (a11y) label Sep 20, 2019
@mmalerba mmalerba added the needs triage This issue needs to be triaged by the team label May 20, 2020
@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround good first issue This issue is a good place to start for first time contributors to the project help wanted The team would appreciate a PR from the community to address this issue and removed needs triage This issue needs to be triaged by the team labels May 27, 2020
@walvekarnikhil
Copy link
Contributor

@Splaktar , can I help in fixing this?
Currently, styles are provided by example-custom-linear-stepper.css
Should we be using neutral colors that can work with both dark & light modes? or we need to use some styles from the pre-built themes?

@Splaktar
Copy link
Contributor Author

@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.

@walvekarnikhil
Copy link
Contributor

@Splaktar ,
Since this is the CDK example we will not be able to use [color] property for the step buttons.
In the prebuilt themes, we don't have any class which can set the text color.

Please let me know if I am missing something here.

Should we create a style which will work for both dark and light mode?

@Splaktar
Copy link
Contributor Author

Ah yes, that's a good point! They are native buttons without any Material classes.

If we remove

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 black to

color: inherit;

Then the button picks up the theme color.

Then for the active step,

.example-step.example-active {
border-bottom: 1px solid blue;
color: blue;
}

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 font-weight instead of a theme color, in addition to the inkbar, to indicate that the step is selected.

Additionally,

.example-nav-button {
background: transparent;
border: 0;
}

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;
}

@walvekarnikhil
Copy link
Contributor

Thanks @Splaktar ,
Here is how it looks now.
Light mode:
Light mode stepper

Dark mode:
Dark mode stepper

@Splaktar
Copy link
Contributor Author

LGTM, does it pass the Lighthouse a11y Audit?

walvekarnikhil added a commit to walvekarnikhil/components that referenced this issue Jul 16, 2020
Removed hard-coded colors and replaced with inherit colors.
Used font-weight to show active step.

Fixes angular#17152
@walvekarnikhil
Copy link
Contributor

@Splaktar ,
I am running this with yarn dev-app, I was not able to run a11y audit with that due to accordions.
I am trying to run this with local build for material.angular.io, will try to run the audit on that.

@Splaktar
Copy link
Contributor Author

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.

walvekarnikhil added a commit to walvekarnikhil/components that referenced this issue Jul 22, 2020
Removed hard-coded colors and replaced with inherit colors.
Used font-weight to show active step.

Fixes angular#17152
walvekarnikhil added a commit to walvekarnikhil/components that referenced this issue Jul 22, 2020
Removed hard-coded colors and replaced with inherit colors.
Used font-weight to show active step.

Fixes angular#17152
wagnermaciel pushed a commit that referenced this issue Jul 22, 2020
)

* 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.
wagnermaciel pushed a commit that referenced this issue Jul 22, 2020
)

* 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)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 22, 2020
wagnermaciel pushed a commit to wagnermaciel/components that referenced this issue Jan 14, 2021
…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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) area: material.angular.io area: material/stepper docs This issue is related to documentation good first issue This issue is a good place to start for first time contributors to the project help wanted The team would appreciate a PR from the community to address this issue P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants