feat: Set auto theme as default theme for zen, b=(no-bug), c=common, tabs

This commit is contained in:
mr. m
2025-05-05 17:26:23 +02:00
parent d816bca7e0
commit cc2c9044f3
9 changed files with 7 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs
index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..ba1a44a0be5b5837467cfc84074d4869aee6aa62 100644
index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..4398108bd6d74aa8b6689baaf5334d8ba9a26c4e 100644
--- a/toolkit/modules/LightweightThemeConsumer.sys.mjs
+++ b/toolkit/modules/LightweightThemeConsumer.sys.mjs
@@ -31,7 +31,7 @@ const toolkitVariableMap = [
@@ -11,26 +11,3 @@ index d8c79cbae4de3ebfc5dc62f3597c7be4965a5429..ba1a44a0be5b5837467cfc84074d4869
}
// Remove the alpha channel
const { r, g, b } = rgbaChannels;
@@ -339,6 +339,7 @@ LightweightThemeConsumer.prototype = {
theme.additionalBackgrounds
);
let _processedColors = _setProperties(root, hasTheme, theme);
+ this._zenSetAccentColor(root);
if (hasTheme) {
if (updateGlobalThemeData) {
@@ -431,6 +432,14 @@ LightweightThemeConsumer.prototype = {
this._lastExperimentData.stylesheet = stylesheet;
}
},
+
+ _zenSetAccentColor(root) {
+ const themeAccent = Services.prefs.getStringPref(
+ "zen.theme.accent-color",
+ "#0b57d0"
+ );
+ root.style.setProperty("--zen-primary-color", themeAccent);
+ },
};
function _getContentProperties(doc, hasTheme, data) {