diff --git a/htdocs/js/ImageView/imageview.js b/htdocs/js/ImageView/imageview.js index ef59fbab5c..3e30ae4736 100644 --- a/htdocs/js/ImageView/imageview.js +++ b/htdocs/js/ImageView/imageview.js @@ -31,6 +31,12 @@ modal.setAttribute('aria-label', 'image view dialog'); modal.tabIndex = -1; + // Force the dialog into light mode. This is needed for a webwork2 page in dark mode since the dialog is outside + // of the problem content. At least until PG is updated to honor dark mode. Further discussion on this will + // also be needed at that time since many images have transparent backgrounds that will not work with a dark + // background. + modal.dataset.bsTheme = 'light'; + const dialog = document.createElement('div'); dialog.classList.add('modal-dialog'); diff --git a/htdocs/js/Knowls/knowl.js b/htdocs/js/Knowls/knowl.js index 496b42a7f6..78a933827f 100644 --- a/htdocs/js/Knowls/knowl.js +++ b/htdocs/js/Knowls/knowl.js @@ -24,6 +24,10 @@ knowl.knowlModal.setAttribute('aria-labelledby', `${knowl.knowlModal.id}-title`); knowl.knowlModal.setAttribute('aria-hidden', 'true'); + // Force the dialog into light mode. This is needed for a webwork2 page in dark mode since the dialog is + // outside of the problem content. At least until PG and the help files are updated to honor dark mode. + knowl.knowlModal.dataset.bsTheme = 'light'; + const knowlDialog = document.createElement('div'); knowlDialog.classList.add( 'knowl-dialog', diff --git a/htdocs/js/Scaffold/scaffold.scss b/htdocs/js/Scaffold/scaffold.scss index a4528e2323..5393d530b5 100644 --- a/htdocs/js/Scaffold/scaffold.scss +++ b/htdocs/js/Scaffold/scaffold.scss @@ -15,6 +15,13 @@ min-width: 1.25rem; font-weight: bold; } + + // Force the accordion button to a dark color so that it has sufficient contrast even if the page is in dark + // mode. Bootstrap wants to use the dark mode color for this if the page is in dark mode. + &::after { + --bs-accordion-btn-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='m2 5 6 6 6-6'/%3E%3C/svg%3E"); + --bs-accordion-btn-active-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23001436' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='m2 5 6 6 6-6'/%3E%3C/svg%3E"); + } } &.cannotopen > button.accordion-button::after {