diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs index 0d3993370b4ecbdfaf87cfd3145617343c29dc39..8587f7286476ca0dcce1bb02ef02ce0dae9c4df7 100644 --- a/toolkit/modules/LightweightThemeConsumer.sys.mjs +++ b/toolkit/modules/LightweightThemeConsumer.sys.mjs @@ -32,7 +32,7 @@ const toolkitVariableMap = [ lwtProperty: "accentcolor", processColor(rgbaChannels) { if (!rgbaChannels || rgbaChannels.a == 0) { - return "white"; + return "var(--zen-colors-primary)"; } // Remove the alpha channel const { r, g, b } = rgbaChannels; @@ -334,6 +334,7 @@ LightweightThemeConsumer.prototype = { theme.additionalBackgrounds ); let _processedColors = _setProperties(root, hasTheme, theme); + this._zenSetAccentColor(root); if (hasTheme) { if (updateGlobalThemeData) { @@ -425,6 +426,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) {