Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(theming): update palette contrast types to current spec #8993

Closed

Conversation

clshortfuse
Copy link
Contributor

@clshortfuse clshortfuse commented Jul 10, 2016

Previous values used out-of-spec colors for contrast.
Low opacities values caused the design to not to meet AA standards
of mininum 4.5 contrast ratio for default text.

  • Set hues with contrast type light to strongLight.
  • Set contrast type for green 500 to dark.

Fixes #8992, #10164

@clshortfuse clshortfuse added ui: theme needs: review This PR is waiting on review from the team labels Jul 10, 2016
@clshortfuse clshortfuse force-pushed the mdTheme-correctContrastColors branch from 62438a2 to dae444b Compare July 10, 2016 14:35
@clshortfuse
Copy link
Contributor Author

Fixes #8992

@@ -17,7 +17,7 @@ angular.module('material.core.theming.palette', [])
'A700': '#d50000',
'contrastDefaultColor': 'light',
'contrastDarkColors': '50 100 200 300 A100',
'contrastStrongLightColors': '400 500 600 700 A200 A400 A700'
'contrastStrongLightColors': '400 500 600 700 800 900 A200 A400 A700'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how you decided that 800 and 900 should be strong light?

@EladBezalel
Copy link
Member

I'm not really sure of what are you trying to do,
According to the Material Design Color Spec the colors you changed aren't matching

@clshortfuse
Copy link
Contributor Author

clshortfuse commented Jul 12, 2016

@EladBezalel See #8992 Spec says opacites 100% now

@ThomasBurleson ThomasBurleson added this to the 1.1.2 milestone Aug 22, 2016
@topherfangio topherfangio added needs: team discussion This issue requires a decision from the team before moving forward. and removed needs: group review labels Sep 9, 2016
@topherfangio
Copy link
Contributor

Needs internal team discussion with Naomi, Jeremy and Erin.

@clshortfuse
Copy link
Contributor Author

We previously discussed theme changes to be pushed back to 1.2.x

@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Nov 16, 2016
Previous values used out-of-spec colors for contrast.
Low opacities values caused the design to not to meet AA standards
of mininum 4.5 contrast ratio for default text.

* Set hues with contrast type `light` to `strongLight`.
* Set contrast type for `green` `500` to `dark`.

Fixes angular#8992, angular#10164
@clshortfuse clshortfuse force-pushed the mdTheme-correctContrastColors branch from dae444b to 4f3e25f Compare December 22, 2016 00:19
@clshortfuse
Copy link
Contributor Author

Rebased. I caught an a11y issue where some colors would not meet WCAG AA guidelines so perhaps we should considering escalate this.

@clshortfuse clshortfuse added the a11y This issue is related to accessibility label Dec 22, 2016
@Splaktar Splaktar removed the needs: team discussion This issue requires a decision from the team before moving forward. label Jan 2, 2018
@Splaktar Splaktar added P2: required Issues that must be fixed. ux: polish labels Jan 2, 2018
@Splaktar Splaktar self-assigned this Jan 2, 2018
@Splaktar Splaktar self-requested a review January 2, 2018 20:49
@Splaktar Splaktar modified the milestones: 1.2.0, 1.1.6 Jan 2, 2018
@Splaktar Splaktar modified the milestones: 1.1.6, 1.1.7 Jan 17, 2018
@Splaktar Splaktar modified the milestones: 1.1.7, 1.2.0 Feb 7, 2018
@Splaktar Splaktar added the needs: manual testing This issue or PR needs to have some manual testing and verification done label Jun 30, 2020
@Splaktar Splaktar requested review from mmalerba and andrewseguin and removed request for mmalerba June 30, 2020 01:03
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

@Splaktar Splaktar removed the needs: review This PR is waiting on review from the team label Jun 30, 2020
Copy link
Contributor

@Splaktar Splaktar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually found that we need to go a lot farther with these changes in order to meet AA contrast guidelines.

I'm going to post another PR with those changes combined with these.

@Splaktar Splaktar added type: bug type: spec alignment For issues related to aligning with the Material Design Spec and removed needs: manual testing This issue or PR needs to have some manual testing and verification done labels Jul 1, 2020
Splaktar added a commit that referenced this pull request Jul 1, 2020
…trasts with AA standards

- properly theme `md-icon`s in toolbars with `md-warn`
- all colors and their contrasts meet 4.5 contrast ratio requirements
  - except a few edge cases which have comments to explain them
- add `aria-labels` to demoInputsInToolbar
- increase opacity of subheader text to meet AA contrast ratio requirements
- increase opacity of input placeholders and labels to meet AA contrast ratio requirements
- minor regexp adjustments for `md-colors`
- fix colors/demoThemePicker and colors/demoBasicUsage to pass Lighthouse a11y audit
- update button/demoBasicUsage to pass Lighthouse a11y audit
- add missing alt tag in demoInCardActions and demoCardActionButtons
- adjust docs app theme to define valid contrast colors for `docs-blue`
- fix inaccurate JSDoc

Fixes #8992. Fixes #10164. Closes #8993.
@clshortfuse
Copy link
Contributor Author

clshortfuse commented Jul 1, 2020

@Splaktar If we're going by the 2014 values, then secondary is 54% opacity on light for black/dark text. If we're going by the 2019 values, that's been bumped up to 60%. It would slightly change your AA values values. (Just an FYI.)

Edit: Actually, don't think this applies specifically to this PR, since these seems like primary text.

@Splaktar
Copy link
Contributor

Splaktar commented Jul 1, 2020

@clshortfuse in general, we're trying to stick to the 2014-2017 spec in this repo. That said, if it comes down to something being inaccessible vs not, then we'll pick the accessible option. In this case, 0.54 vs 0.6 opacity doesn't seem like it will have a significant impact on a11y.

Thank you for taking a look.

Splaktar added a commit that referenced this pull request Jul 2, 2020
…trasts with AA standards

- properly theme `md-icon`s in toolbars with `md-warn`
- all colors and their contrasts meet 4.5 contrast ratio requirements
  - except a few edge cases which have comments to explain them
- add `aria-labels` to demoInputsInToolbar
- increase opacity of subheader text to meet AA contrast ratio requirements
- increase opacity of input placeholders and labels to meet AA contrast ratio requirements
- minor regexp adjustments for `md-colors`
- fix colors/demoThemePicker and colors/demoBasicUsage to pass Lighthouse a11y audit
- update button/demoBasicUsage to pass Lighthouse a11y audit
- add missing alt tag in demoInCardActions and demoCardActionButtons
- adjust docs app theme to define valid contrast colors for `docs-blue`
- fix inaccurate JSDoc

Fixes #8992. Fixes #10164. Closes #8993.

BREAKING CHANGE: The contrast colors (the text or icon color, for example on a raised button) of many of our default palettes have been updated to meet the [AA level of the contrast guidelines](https://www.w3.org/TR/WCAG21/#contrast-minimum) for web accessibility. If you are using our default palettes directly, the accessibility of your application should be improved. However, we recommend that you evaluate this after updating to `1.2.0`. There may be edge cases in your app or custom styles that need to be updated to meet accessibility guidelines.

If you find significant accessibility issues after updating, please report them to us. In `1.2.x`, we have a lot more control over our component theming in regards to hues and opacities.

If your app is using a custom palette, whether based on a copy of default palette or not, we encourage you to evaluate that your contrast configuration meets the WebAIM guidelines. Please review our guide on [Defining Custom Palettes](https://material.angularjs.org/latest/Theming/03_configuring_a_theme#defining-custom-palettes) for details.
Splaktar added a commit that referenced this pull request Jul 2, 2020
…trasts with AA standards

- properly theme `md-icon`s in toolbars with `md-warn`
- all colors and their contrasts meet 4.5 contrast ratio requirements
  - except a few edge cases which have comments to explain them
- add `aria-labels` to demoInputsInToolbar
- increase opacity of subheader text to meet AA contrast ratio requirements
- increase opacity of input placeholders and labels to meet AA contrast ratio requirements
- minor regexp adjustments for `md-colors`
- fix colors/demoThemePicker and colors/demoBasicUsage to pass Lighthouse a11y audit
- update button/demoBasicUsage to pass Lighthouse a11y audit
- add missing alt tag in demoInCardActions and demoCardActionButtons
- adjust docs app theme to define valid contrast colors for `docs-blue`
- fix inaccurate JSDoc

Fixes #8992. Fixes #10164. Closes #8993.

BREAKING CHANGE: The contrast colors (the text or icon color, for example on a raised button) of many of our default palettes have been updated to meet the [AA level of the contrast guidelines](https://www.w3.org/TR/WCAG21/#contrast-minimum) for web accessibility. If you are using our default palettes directly, the accessibility of your application should be improved. However, we recommend that you evaluate this after updating to `1.2.0`. There may be edge cases in your app or custom styles that need to be updated to meet accessibility guidelines.

If you find significant accessibility issues after updating, please report them to us. In `1.2.x`, we have a lot more control over our component theming in regards to hues and opacities.

If your app is using a custom palette, whether based on a copy of default palette or not, we encourage you to evaluate that your contrast configuration meets the WebAIM guidelines. Please review our guide on [Defining Custom Palettes](https://material.angularjs.org/latest/Theming/03_configuring_a_theme#defining-custom-palettes) for details.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P2: required Issues that must be fixed. type: bug type: spec alignment For issues related to aligning with the Material Design Spec ui: theme ux: polish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

theme: palettes using outdated opacity for light contrast
8 participants