-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
report: improve color contrast of top-level errors #10636
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
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.
thanks for capturing the details in the issue! there's a small contrast issue, but most of my comments have to due with maintaining the consistency in this file.
@@ -66,7 +67,7 @@ | |||
--color-informative: var(--color-blue-900); | |||
--color-pass-secondary: var(--color-green-700); | |||
--color-pass: var(--color-green); | |||
--color-hover: var(--color-gray-50); | |||
--color-hover: var(--color-gray-50); |
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.
could you alphabetize this? you can just select all the lines and "sort" in your IDE–we keep everything here sorted.
also I think there is some whitespace at the end of this line (and a couple others)
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.
Corrected these
@@ -1010,16 +1011,21 @@ | |||
|
|||
.lh-warnings--toplevel { | |||
--item-margin: calc(var(--header-line-height) / 4); | |||
color: var(--report-text-color-secondary); | |||
color: var(--report-text-color); |
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.
can you make a --toplevel-warning-text-color
variable, initialized to var(--report-text-color)
, and vary it to var(--color-orange-700)
in dark mode? Trying to solve these things:
- color contrast in light mode for this text fails the axe audit. Let's ignore the color given in the design for that and just use black.
- we try not to use colors directly in the css, but instead alias to a component variable. see the "naming" comment at the top of the file
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 may have misunderstood this so apologies if this needs corrected.
I believe it was the text "There were issues affecting this run of Lighthouse:" that was causing the contrast issue, the text color for this is controlled by the .lh-warnings__msg class so I have created another component variable for this text color along with the --toplevel-warning-text-color requested.
I think I've followed the correct conventions for this but I'm unsure if the result is exactly what you were looking for.
max-width: calc(var(--report-width) - var(--category-padding) * 2); | ||
background-color: var(--color-amber-50); | ||
max-width: calc(var(--report-width) - var(--category-padding) * 2); | ||
background-color: rgba(var(--color-orange-rgb), .1); |
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.
introduce a new variable --toplevel-warning-background-color
Instead of using alpha, I think we want it set to orange 100 (#FFCCBC) in light mode and #544B40 for dark mode (I don't see a clean fit from the material ui colors, oh well)
initial value: var(--color-orange-100)
dark mode: #544B40
(unless you can find a good material ui color)
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.
Corrected this, although I set the light mode background color to orange-50 instead of orange-100 as I felt this was a closer match to the original color
@baseeee thanks for your contributions so far! I think this is important for our 6.0 release in ~3 weeks. Are you able to incorporate the feedback by then? If not, I'm happy to take over. |
@connorjclark Hello, sorry for my periods of inactivity, life's been pretty manic recently but I still really want to help out. I can sort out the issues this weekend if that suits your timescale. Thank you for the comprehensive notes and feedback too, it's a massive help. |
No worries! There's still plenty of time :) |
A quick note. We're cutting our release next week, actually. We'll very happily finish off this PR monday if you don't get around to it, @baseeee. No big deal either way. :D |
@connorjclark I've finished making these changes, sorry if you still need to tweek anything before the release. Thanks for letting me help out :) |
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.
thanks for sticking to it! css and vars look good. only thing left are trivial:
- using spaces instead of tabs (sry! I wish we had a linter for this)
- asking @hwikyounglee if we meant to drop the bold text
@@ -18,7 +18,7 @@ | |||
<!-- Lighthouse run warnings --> | |||
<template id="tmpl-lh-warnings--toplevel"> | |||
<div class="lh-warnings lh-warnings--toplevel"> | |||
<strong class="lh-warnings__msg"></strong> | |||
<p class="lh-warnings__msg"></p> |
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.
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.
Per the design
- No bold
- On the light mode: the title 'There were...' should be in orange #d04900
Could we try the color for the light mode?
I think the colors would do it without bold weight.
Side note: the orange in dark mode is #ffa400
https://yuinchien.com/sandbox/lighthouse/ (click on the (i) at the top right, and also 'd' for light/dark toggle)
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.
the color contrast for those light colors #d04900 (text) and rgb(255, 246, 234) (background) has too low contrast according to axe :(
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.
Wondering if we're in a place to add or replace the color with #BD4200
It's 4.97
https://contrast-ratio.com/#%23BD4200-on-%20rgb%28255%2C%20246%2C%20234%29
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.
thanks @baseeee and @hwikyounglee ! lookin good https://lighthouse-fxbzonyd8.now.sh/error/ |
Summary
Added higher contrast colors and made slight layout adjustments to the runtime error warning box on the report webpage.
Related Issues/PRs
#9559