fix: use default zen accent color and revert changes related to accent color (#10187)

* fix: use AccentColor variable and revert changes related to accent color

* fix: revert default accent color to zen accent color
This commit is contained in:
reizumi
2025-09-02 00:09:35 +08:00
committed by GitHub
parent 4420d0df8c
commit 236b5dc5c7
4 changed files with 3 additions and 22 deletions

View File

@@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
- name: zen.theme.accent-color
value: 'system'
value: '#ffb787'
- name: zen.theme.content-element-separation
value: 8

View File

@@ -48,13 +48,6 @@
isolation: isolate;
background: var(--zen-themed-toolbar-bg-transparent);
/*
* Important: We set the color to `AccentColor` so we can
* Compute the stylings and get the native accent color.
* Please, do not remove this.
*/
color: AccentColor;
&::after,
&::before {
content: '';

View File

@@ -97,10 +97,7 @@ var ZenThemeModifier = {
* Update the accent color.
*/
updateAccentColor() {
let accentColor = Services.prefs.getStringPref('zen.theme.accent-color');
if (accentColor.startsWith('system:')) {
accentColor = accentColor.replace('system:', '').trim();
}
const accentColor = Services.prefs.getStringPref('zen.theme.accent-color');
document.documentElement.style.setProperty('--zen-primary-color', accentColor);
},
};

View File

@@ -1501,16 +1501,7 @@
getNativeAccentColor() {
const accentColor = Services.prefs.getStringPref('zen.theme.accent-color');
let rgb;
if (accentColor.startsWith('system')) {
const rawRgb = window.getComputedStyle(document.getElementById('zen-browser-background'))[
'color'
];
Services.prefs.setStringPref('zen.theme.accent-color', `system:${rawRgb}`);
rgb = rawRgb.match(/\d+/g).map(Number);
} else {
rgb = this.hexToRgb(accentColor);
}
const rgb = this.hexToRgb(accentColor);
if (this.isDarkMode) {
// If the theme is dark, we want to use a lighter color
return this.blendColors(rgb, [0, 0, 0], 40);