-
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: add options disableFireworks and disableDarkMode #13649
Conversation
report/clients/standalone.js
Outdated
|
||
// Fireworks look better in dark mode. | ||
if (reportRootEl.querySelector('.lh-score100')) { | ||
toggleDarkTheme(new DOM(document, reportRootEl), true); |
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 like the idea of abstracting DOM
behind renderReport
. IMO it would be better to have a enableDarkModeWithFireworks
option and moving this logic back to ReportUIFeatures
. We could also use it for the report viewer.
There is also an argument to remove this feature, it can be unexpected for some users #13631.
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.
It was unexpected because there were no fireworks. With fireworks, there is context, and it is clearly an easter egg.
I like the idea of abstracting DOM behind renderReport.
If only the standalone report needs this, I'm fine keeping this internal.
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.
If only the standalone report needs this, I'm fine keeping this internal.
What about report viewer?
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.
hmmm forgot about that... ok how's the new changeset?
Deciding to use the dark theme should be left to the embedder, in case it wouldn't mesh with the site theme. We tried to do this with
disableAutoDarkModeAndFireworks
but:This PR:
disableAutoDarkModeAndFireworks
disableDarkMode
option (embedders such as DevTools can set this and defer to the DevTools theme system to toggle the dark theme; or they can set it because the site should never be displayed in a dark theme and having just LH be dark would be jarring)disableFireworks
option