-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(theming): update palette contrast types to current spec #8993
fix(theming): update palette contrast types to current spec #8993
Conversation
62438a2
to
dae444b
Compare
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' |
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.
how you decided that 800 and 900 should be strong light?
I'm not really sure of what are you trying to do, |
@EladBezalel See #8992 Spec says opacites 100% now |
Needs internal team discussion with Naomi, Jeremy and Erin. |
We previously discussed theme changes to be pushed back to 1.2.x |
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
dae444b
to
4f3e25f
Compare
Rebased. I caught an a11y issue where some colors would not meet WCAG AA guidelines so perhaps we should considering escalate this. |
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.
Seems fine to me
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.
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.
…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.
@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. |
@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, Thank you for taking a look. |
…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.
…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.
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.
light
tostrongLight
.green
500
todark
.Fixes #8992, #10164