From 5b48f5878c6619576baf552afe4ce86657c6e6cb Mon Sep 17 00:00:00 2001 From: wuggy Date: Sun, 5 Apr 2026 14:25:41 +0100 Subject: [PATCH] fix some CSS issues on OS X --- .../basilisk/themes/windows/browser.css | 16 ++++ toolkit/themes/osx/global/button.css | 10 +++ toolkit/themes/osx/global/global.css | 4 +- toolkit/themes/osx/global/wizard.css | 81 +++++++++++++++++++ 4 files changed, 110 insertions(+), 1 deletion(-) diff --git a/application/basilisk/themes/windows/browser.css b/application/basilisk/themes/windows/browser.css index 29453584ad..10ac79ae1d 100644 --- a/application/basilisk/themes/windows/browser.css +++ b/application/basilisk/themes/windows/browser.css @@ -5651,6 +5651,22 @@ toolbar[brighttext] scrollbarbutton:hover { z-index: auto !important; } +@media (prefers-color-scheme: dark) { + #main-window > #titlebar, + #main-window[tabsintitlebar] > #titlebar, + #main-window > #titlebar > #titlebar-content, + #main-window[tabsintitlebar] > #titlebar > #titlebar-content, + #main-window[tabsintitlebar] #TabsToolbar, + #main-window #toolbar-menubar, + #main-window #navigator-toolbox { + -moz-appearance: none !important; + background-image: none !important; + background-color: #2b2b2b !important; + color: #e6e6e6 !important; + border-color: #2b2b2b !important; + } +} + /* Ensure webpage content uses the full client area on macOS. */ #main-window > #tab-view-deck, #main-window > #tab-view-deck > #browser-panel, diff --git a/toolkit/themes/osx/global/button.css b/toolkit/themes/osx/global/button.css index 45f292e1f1..8f4338bed7 100644 --- a/toolkit/themes/osx/global/button.css +++ b/toolkit/themes/osx/global/button.css @@ -51,6 +51,16 @@ button[disabled="true"] { color: GrayText; } +:root:-moz-lwtheme-brighttext button, +:root[lwtheme-brighttext] button { + color: #f0f0f0; +} + +:root:-moz-lwtheme-brighttext button[disabled="true"], +:root[lwtheme-brighttext] button[disabled="true"] { + color: #8d8d8d; +} + /* ::::: menu/menu-button buttons ::::: */ button[type="menu-button"] { diff --git a/toolkit/themes/osx/global/global.css b/toolkit/themes/osx/global/global.css index 261abe3138..6cf3b208fb 100644 --- a/toolkit/themes/osx/global/global.css +++ b/toolkit/themes/osx/global/global.css @@ -32,7 +32,9 @@ wizard, prefwindow { -moz-appearance: dialog; background-color: #FFFFFF; - color: -moz-DialogText; + /* macOS dark mode can map -moz-DialogText to light text while this + * surface remains light, so force an explicit readable foreground. */ + color: #1f1f1f; font: message-box; } diff --git a/toolkit/themes/osx/global/wizard.css b/toolkit/themes/osx/global/wizard.css index 9c5e6200ce..4e81d0d433 100644 --- a/toolkit/themes/osx/global/wizard.css +++ b/toolkit/themes/osx/global/wizard.css @@ -60,3 +60,84 @@ wizard[branded="true"] .wizard-header-icon { font: menu !important; } +/* On macOS dark appearance, avoid relying on semantic colors that can + * produce white-on-light combinations in XUL wizard chrome. */ +:root:-moz-lwtheme-brighttext wizard, +:root[lwtheme-brighttext] wizard { + -moz-appearance: none !important; + background-color: #2b2b2b !important; + color: #e6e6e6 !important; +} + +:root:-moz-lwtheme-brighttext .wizard-header, +:root[lwtheme-brighttext] .wizard-header, +:root:-moz-lwtheme-brighttext .wizard-page-box, +:root[lwtheme-brighttext] .wizard-page-box, +:root:-moz-lwtheme-brighttext .wizard-buttons-btm, +:root[lwtheme-brighttext] .wizard-buttons-btm { + -moz-appearance: none !important; + background-color: #2b2b2b !important; + color: #e6e6e6 !important; +} + +:root:-moz-lwtheme-brighttext .wizard-header-box-1, +:root[lwtheme-brighttext] .wizard-header-box-1, +:root:-moz-lwtheme-brighttext .wizard-header-label, +:root[lwtheme-brighttext] .wizard-header-label, +:root:-moz-lwtheme-brighttext description, +:root[lwtheme-brighttext] description, +:root:-moz-lwtheme-brighttext label, +:root[lwtheme-brighttext] label { + color: #f0f0f0 !important; +} + +:root:-moz-lwtheme-brighttext .wizard-buttons-separator, +:root[lwtheme-brighttext] .wizard-buttons-separator { + border-bottom: 1px solid #505050 !important; +} + +@media (prefers-color-scheme: dark) { + wizard, + .wizard-header, + .wizard-page-box, + .wizard-buttons-btm { + -moz-appearance: none !important; + background-color: #2b2b2b !important; + color: #e6e6e6 !important; + } + + .wizard-header-box-1, + .wizard-header-label, + description, + label { + color: #f0f0f0 !important; + } + + .wizard-buttons-separator { + border-bottom: 1px solid #505050 !important; + } + + .wizard-button { + -moz-appearance: none !important; + background-color: #3b3b3b !important; + color: #f0f0f0 !important; + border: 1px solid #5f5f5f !important; + border-radius: 6px !important; + text-shadow: none !important; + } + + .wizard-button:hover:not([disabled="true"]) { + background-color: #4a4a4a !important; + } + + .wizard-button:hover:active:not([disabled="true"]) { + background-color: #2f2f2f !important; + } + + .wizard-button[disabled="true"] { + color: #8d8d8d !important; + border-color: #505050 !important; + background-color: #333333 !important; + } +} +