mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
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:
@@ -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
|
||||
|
@@ -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: '';
|
||||
|
@@ -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);
|
||||
},
|
||||
};
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user