File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -445,14 +445,15 @@ const PDFViewerApplication = {
445445 const container = appConfig . mainContainer ,
446446 viewer = appConfig . viewerContainer ;
447447 const annotationEditorMode = AppOptions . get ( "annotationEditorMode" ) ;
448- const pageColors =
448+ const hasForcedColors =
449449 AppOptions . get ( "forcePageColors" ) ||
450- window . matchMedia ( "(forced-colors: active)" ) . matches
451- ? {
452- background : AppOptions . get ( "pageColorsBackground" ) ,
453- foreground : AppOptions . get ( "pageColorsForeground" ) ,
454- }
455- : null ;
450+ window . matchMedia ( "(forced-colors: active)" ) . matches ;
451+ const pageColors = hasForcedColors
452+ ? {
453+ background : AppOptions . get ( "pageColorsBackground" ) ,
454+ foreground : AppOptions . get ( "pageColorsForeground" ) ,
455+ }
456+ : null ;
456457
457458 let altTextManager ;
458459 if ( AppOptions . get ( "enableUpdatedAddImage" ) ) {
@@ -521,7 +522,8 @@ const PDFViewerApplication = {
521522 eventBus ,
522523 linkService ,
523524 overlayManager ,
524- ltr
525+ ltr ,
526+ hasForcedColors
525527 )
526528 : null ;
527529
Original file line number Diff line number Diff line change 8484 --comment-button-focus-outline-color : light-dark (# 0062fa, # 00cadb );
8585
8686 @media screen and (forced-colors : active) {
87- --comment-button-bg : Canvas ;
87+ --comment-button-bg : ButtonFace ;
8888 --comment-button-fg : ButtonText;
89- --comment-button-hover-bg : Canvas ;
90- --comment-button-hover-fg : Highlight ;
91- --comment-button-active-bg : Canvas ;
92- --comment-button-active-fg : Highlight ;
89+ --comment-button-hover-bg : SelectedItemText ;
90+ --comment-button-hover-fg : SelectedItem ;
91+ --comment-button-active-bg : SelectedItemText ;
92+ --comment-button-active-fg : SelectedItem ;
9393 --comment-button-border-color : ButtonBorder;
9494 --comment-button-active-border-color : ButtonBorder;
95- --comment-button-hover-border-color : Highlight ;
95+ --comment-button-hover-border-color : SelectedItem ;
9696 --comment-button-box-shadow : none;
9797 --comment-button-focus-outline-color : CanvasText;
9898 --comment-button-selected-bg : ButtonBorder;
Original file line number Diff line number Diff line change @@ -34,13 +34,16 @@ class CommentManager {
3434
3535 #sidebar;
3636
37+ static #hasForcedColors = null ;
38+
3739 constructor (
3840 commentDialog ,
3941 sidebar ,
4042 eventBus ,
4143 linkService ,
4244 overlayManager ,
43- ltr
45+ ltr ,
46+ hasForcedColors
4447 ) {
4548 const dateFormat = new Intl . DateTimeFormat ( undefined , {
4649 dateStyle : "long" ,
@@ -56,6 +59,7 @@ class CommentManager {
5659 dateFormat
5760 ) ;
5861 this . #popup. sidebar = this . #sidebar;
62+ CommentManager . #hasForcedColors = hasForcedColors ;
5963 }
6064
6165 setSidebarUiManager ( uiManager ) {
@@ -110,10 +114,12 @@ class CommentManager {
110114 }
111115
112116 static _makeCommentColor ( color , opacity ) {
113- return findContrastColor (
114- applyOpacity ( ...color , opacity ?? 1 ) ,
115- CSSConstants . commentForegroundColor
116- ) ;
117+ return this . #hasForcedColors
118+ ? null
119+ : findContrastColor (
120+ applyOpacity ( ...color , opacity ?? 1 ) ,
121+ CSSConstants . commentForegroundColor
122+ ) ;
117123 }
118124
119125 destroy ( ) {
You can’t perform that action at this time.
0 commit comments