components icon indicating copy to clipboard operation
components copied to clipboard

fix(material/divider): non-text color contrast issues

Open DBowen33 opened this issue 1 month ago • 3 comments

Fixes color contrast issues with non-text elements, including divider. Changed from "outline-variant" to "outline" colors to pass 3:1 ratio between light/dark mode backgrounds. Also changing for expansion, stepper, and table so they can also pass not-text color contrast.

Before (Light mode): FG- #c4c6d0 (neutral-variant80) BG- #fff Ratio: 1.70:1 Screenshot: image

After (Light mode): FG- #747775 (neutral-variant50) BG- #fff Ratio: 4.52:1 Screenshot: image

Before (Dark mode): FG- #44474E (neutral-variant30) BG- #1f1f1f Ratio: 1.77:1 Screenshot: image

After (Dark mode): FG- #8e9099 (neutral-variant60) BG- #1f1f1f Ratio: 5.17:1 Screenshot: image

Fixes b/291964002

DBowen33 avatar May 02 '24 19:05 DBowen33

Unfortunately the spec explicitly states that it does not account for contrast ratios for the divider. Whether we go with outline or some slightly less-contrasty color, I think it's going to look strange at a the minimum 3:1 ratio. This one is a bit out of our hands unless we want to revise this to be a different palette color than outline.

To make this a little more acceptable, can we update the list demo's outline color to match this value? It does look weird that the list outline is so much lighter than the divider

andrewseguin avatar May 04 '24 01:05 andrewseguin

Unfortunately the spec explicitly states that it does not account for contrast ratios for the divider. Whether we go with outline or some slightly less-contrasty color, I think it's going to look strange at a the minimum 3:1 ratio. This one is a bit out of our hands unless we want to revise this to be a different palette color than outline.

To make this a little more acceptable, can we update the list demo's outline color to match this value? It does look weird that the list outline is so much lighter than the divider

Changed border color in demo list to match mat-divider color so it looks visually better

DBowen33 avatar May 08 '24 16:05 DBowen33

Deployed dev-app for e65e9d90b9305b417676754319521fe71e7b6737 to: https://ng-dev-previews-comp--pr-angular-components-28995-dev-nng8pkz4.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

github-actions[bot] avatar May 09 '24 17:05 github-actions[bot]