-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Use the light-dark
CSS function in the viewer (issue 17780)
#19819
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
Conversation
89da7be
to
fa29abc
Compare
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0ec1e5b6873b486/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/ff0cf034ced8020/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/0ec1e5b6873b486/output.txt Total script time: 12.64 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/ff0cf034ced8020/output.txt Total script time: 31.06 mins
|
fa29abc
to
6244144
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.
LGTM. Thank you.
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.
LGTM. Thank you.
6244144
to
3963cb2
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c44e3ab003f2fad/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/c44e3ab003f2fad/output.txt Total script time: 0.86 mins Published |
Unfortunately there's one remaining issue that I've not been able to understand, and much less fix. @calixteman Any ideas here? The color-inputs, for the FreeText and Ink editors, are now affected by the global I thought that adding a Lines 1144 to 1149 in 213d51d
Please see the following screen-shots, from the latest preview, that show the lack of effect from the override. |
Oh, it seems that the initial color comes from pdf.js/src/display/editor/editor.js Lines 209 to 215 in 63e6566
pdf.js/src/display/display_utils.js Lines 562 to 572 in 63e6566
color-scheme setting.
@calixteman Is the new behaviour perhaps then correct/expected here, or do we want to keep using a black default color and if so how best to implement that? |
3963cb2
to
46c3a27
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/5f5382e3600a080/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/5f5382e3600a080/output.txt Total script time: 0.87 mins Published |
The latest version of the patch keeps the old behaviour for these |
46c3a27
to
cf56e53
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 color of an added signature in dark mode is not correct:
https://github.com/mozilla/pdf.js/blob/master/src/display/editor/signature.js#L29-L46
We should probably use AnnotationEditor._defaultLineColor
instead of CanvasText
.
3e48440
to
b03cd96
Compare
That seemed to work, thank you. /botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.241.84.105:8877/8c374cd3dea6e56/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/8c374cd3dea6e56/output.txt Total script time: 0.94 mins Published |
Would it be possible to add an integration test in order to test that the color of an added signature is correct whatever the mode is ? |
This removes the need for (most) separate `@media (prefers-color-scheme: dark)` blocks when defining colors values, and also provides a simple way of forcing use of either the light or dark theme. Please refer to https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark and https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme *NOTE:* To support this in older browsers, we utilize a [PostCSS plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-light-dark-function).
b03cd96
to
ae1cbc6
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.
LGTM. Thank you.
That should be possible, and I've done my best to add a couple of new tests for this (however I'm not great at writing integration-tests). /botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.241.84.105:8877/acd26b2ea58cc34/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/77105792e03b5f4/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/acd26b2ea58cc34/output.txt Total script time: 13.76 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/77105792e03b5f4/output.txt Total script time: 30.57 mins
|
This removes the need for (most) separate
@media (prefers-color-scheme: dark)
blocks when defining colors values, and also provides a simple way of forcing use of either the light or dark theme.Please refer to https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark and https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
NOTE: To support this in older browsers, we utilize a PostCSS plugin.
This patch reduces the size of the
gulp mozcentral
target by5302
bytes.