-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Remove the viewerCssTheme
-option, since it's partially broken
#17222
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/35fa5addf0e2cb9/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/35fa5addf0e2cb9/output.txt Total script time: 1.40 mins Published |
The `viewerCssTheme`-implementation has always been somewhat hacky, and now it's also *partially* broken ever since we've started using CSS nesting. Trying to support nested media queries would thus require a lot more parsing of the CSS rules, which seems inefficient and thus generally undesirable.[1] As discussed on Matrix, let's try to remove the `viewerCssTheme`-option and see if there's any (significant) fallout from this. --- [1] If this option is brought back, it seems to me that it (in Firefox) should probably be set through the platform-code that handles theming.
a1cbdcb
to
d46578e
Compare
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 change itself looks good, but since I can't really tell how many people use this functionality, and if it's therefore useful to keep or not, I'd also like @calixteman to sign off on this before merging.
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 option exists in Firefox but it's hidden and totally undocumented so it's fine to remove it.
Thank you.
I'm one day late to the party... but can this functionality be restored? The Chrome extension has historically been using the dark theme, and the viewerCssTheme preference is relied upon by the extension in #13841 |
If runtime parsing is a concern, an alternative is to do that at compile time, by extracting the parts with "prefers-color-scheme", and generate a separate stylesheet with only these rules. If the pref is set to anything but the default (forced light/dark), then the viewer code can load the extra stylesheet that unconditionally applies the light/dark theme. |
Is there any other way to manually change pdfjs theme? It was very useful option for us. |
so how can i force dark theme in pdf viewer in version 121.0? |
The
viewerCssTheme
-implementation has always been somewhat hacky, and now it's also partially broken ever since we've started using CSS nesting.Trying to support nested media queries would thus require a lot more parsing of the CSS rules, which seems inefficient and thus generally undesirable.[1]
As discussed on Matrix, let's try to remove the
viewerCssTheme
-option and see if there's any (significant) fallout from this.[1] If this option is brought back, it seems to me that it (in Firefox) should probably be set through the platform-code that handles theming.