mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-15 14:26:12 +00:00
Refactor element separation handling in ZenThemeModifier and update references in ZenCompactMode and ZenViewSplitter
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
const kZenThemePrefsList = ['zen.theme.accent-color', 'zen.theme.border-radius', 'zen.theme.content-element-separation'];
|
||||
const kZenMaxElementSeparation = 12;
|
||||
|
||||
/**
|
||||
* ZenThemeModifier controls the application of theme data to the browser,
|
||||
@@ -68,7 +69,7 @@ var ZenThemeModifier = {
|
||||
},
|
||||
|
||||
updateElementSeparation() {
|
||||
const separation = Services.prefs.getIntPref('zen.theme.content-element-separation');
|
||||
let separation = this.elementSeparation;
|
||||
document.documentElement.style.setProperty('--zen-element-separation', separation + 'px');
|
||||
if (separation == 0) {
|
||||
document.documentElement.setAttribute('zen-no-padding', true);
|
||||
@@ -77,6 +78,10 @@ var ZenThemeModifier = {
|
||||
}
|
||||
},
|
||||
|
||||
get elementSeparation() {
|
||||
return Math.min(Services.prefs.getIntPref('zen.theme.content-element-separation'), kZenMaxElementSeparation);
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the accent color.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user