[go: nahoru, domu]

Skip to content
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: only print light theme #9173

Merged
merged 2 commits into from
Jun 11, 2019
Merged

report: only print light theme #9173

merged 2 commits into from
Jun 11, 2019

Conversation

connorjclark
Copy link
Collaborator

Fixes #9155.

Copy link
Collaborator
@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

nice this worked out nicely and super cleanly!

worth a test?

* @param {Function} cb
*/
_setLightThemeTemporarily(cb) {
const isDark = this._dom.find('.lh-vars', this._document).classList.contains('dark');
Copy link
Collaborator

Choose a reason for hiding this comment

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

yikes 😆 I wonder if we should use a variable or something in ReportUIFeatures state...

misread and realized this was testing classList and not textContent but a function or something that encapsulates this might be nice

Copy link
Member
@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

seems like what @media print was made for? We couldn't do expansion that way because audit content is in <details> elements, but seems like this would be possible?

@connorjclark
Copy link
Collaborator Author
connorjclark commented Jun 10, 2019

How could a media rule unapply the .dark rules?

is @media not print { supported?

EDIT: yeah that works

@brendankenny
Copy link
Member

How could a media rule unapply the .dark rules?

217b768

:P

@patrickhulce
Copy link
Collaborator

image

Copy link
Collaborator
@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

all kidding aside, I do think @hoten 's old approach would be a great candidate for the expansion business to avoid mucking up the selection state!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Printing in dark mode should not be possible
4 participants