mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-29 06:28:39 +00:00
chore: Update zen theme content element separation
This commit is contained in:
@@ -69,6 +69,7 @@ pref('zen.tabs.vertical', true);
|
|||||||
pref('zen.tabs.vertical.right-side', false);
|
pref('zen.tabs.vertical.right-side', false);
|
||||||
pref('zen.theme.accent-color', "#aac7ff");
|
pref('zen.theme.accent-color', "#aac7ff");
|
||||||
pref('zen.theme.border-radius', 10); // In pixels
|
pref('zen.theme.border-radius', 10); // In pixels
|
||||||
|
pref('zen.theme.content-element-separation', 10); // In pixels
|
||||||
pref('zen.theme.toolbar-themed', true);
|
pref('zen.theme.toolbar-themed', true);
|
||||||
pref('zen.theme.pill-button', false);
|
pref('zen.theme.pill-button', false);
|
||||||
pref('zen.view.compact', false);
|
pref('zen.view.compact', false);
|
||||||
|
Submodule src/browser/base/content/zen-components updated: 9a5efb4a87...a71e589dcf
@@ -2,7 +2,6 @@
|
|||||||
:root:not([inDOMFullscreen="true"]):not([chromehidden~="location"]):not([chromehidden~="toolbar"]) {
|
:root:not([inDOMFullscreen="true"]):not([chromehidden~="location"]):not([chromehidden~="toolbar"]) {
|
||||||
& #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
& #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
||||||
width: -moz-available;
|
width: -moz-available;
|
||||||
margin: 0 var(--zen-element-separation) var(--zen-element-separation) 0;
|
|
||||||
box-shadow: 0 0 0 1px var(--zen-colors-border);
|
box-shadow: 0 0 0 1px var(--zen-colors-border);
|
||||||
clip-path: inset(-5px -5px -5px round var(--zen-webview-border-radius, var(--zen-border-radius)));
|
clip-path: inset(-5px -5px -5px round var(--zen-webview-border-radius, var(--zen-border-radius)));
|
||||||
border-radius: var(--zen-webview-border-radius, var(--zen-border-radius));
|
border-radius: var(--zen-webview-border-radius, var(--zen-border-radius));
|
||||||
|
@@ -11,6 +11,11 @@
|
|||||||
--inactive-titlebar-opacity: 1;
|
--inactive-titlebar-opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tabbrowser-tabpanels {
|
||||||
|
padding-right: var(--zen-element-separation);
|
||||||
|
padding-bottom: var(--zen-element-separation);
|
||||||
|
}
|
||||||
|
|
||||||
#browser {
|
#browser {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@@ -131,8 +131,8 @@
|
|||||||
#navigator-toolbox[inFullscreen] > #PersonalToolbar,
|
#navigator-toolbox[inFullscreen] > #PersonalToolbar,
|
||||||
#PersonalToolbar[collapsed="true"]{ display: none }
|
#PersonalToolbar[collapsed="true"]{ display: none }
|
||||||
|
|
||||||
:root:not([inDOMFullscreen="true"]) #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
:root:not([inDOMFullscreen="true"]) #tabbrowser-tabbox #tabbrowser-tabpanels {
|
||||||
margin-left: var(--zen-element-separation) !important;
|
padding-left: var(--zen-element-separation) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (-moz-bool-pref: "zen.view.compact.hide-toolbar") {
|
@media (-moz-bool-pref: "zen.view.compact.hide-toolbar") {
|
||||||
@@ -162,8 +162,8 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root:not([inDOMFullscreen="true"]) #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
:root:not([inDOMFullscreen="true"]) #tabbrowser-tabpanels {
|
||||||
margin-top: var(--zen-element-separation) !important;
|
padding-top: var(--zen-element-separation) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#titlebar {
|
#titlebar {
|
||||||
|
@@ -31,7 +31,8 @@
|
|||||||
|
|
||||||
#tabbrowser-tabpanels:has(> [zen-split="true"]) {
|
#tabbrowser-tabpanels:has(> [zen-split="true"]) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 5px;
|
row-gap: var(--zen-element-separation);
|
||||||
|
column-gap: calc(var(--zen-element-separation) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#zen-split-views-box:not([hidden="true"]) {
|
#zen-split-views-box:not([hidden="true"]) {
|
||||||
|
@@ -460,6 +460,11 @@
|
|||||||
--zen-hover-animation: zen-sidebar-panel-animation-right !important;
|
--zen-hover-animation: zen-sidebar-panel-animation-right !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tabbrowser-tabpanels {
|
||||||
|
padding-left: var(--zen-element-separation);
|
||||||
|
padding-right: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
:root:not([zen-sidebar-legacy="true"]) {
|
:root:not([zen-sidebar-legacy="true"]) {
|
||||||
padding: calc(var(--zen-tabbrowser-padding) * 1.5);
|
padding: calc(var(--zen-tabbrowser-padding) * 1.5);
|
||||||
}
|
}
|
||||||
@@ -469,8 +474,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#tabbrowser-tabpanels .browserSidebarContainer {
|
#tabbrowser-tabpanels .browserSidebarContainer {
|
||||||
margin-left: var(--zen-element-separation) !important;
|
margin-left: 0 !important;
|
||||||
margin-right: 0 !important;
|
margin-right: 2px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,9 +80,6 @@
|
|||||||
--toolbar-field-focus-background-color: var(--urlbar-box-bgcolor) !important;
|
--toolbar-field-focus-background-color: var(--urlbar-box-bgcolor) !important;
|
||||||
--zen-input-border-color: light-dark(rgb(204, 204, 204), rgb(66, 65, 77));
|
--zen-input-border-color: light-dark(rgb(204, 204, 204), rgb(66, 65, 77));
|
||||||
|
|
||||||
/* Constants */
|
|
||||||
--zen-element-separation: .6rem;
|
|
||||||
|
|
||||||
/* XUL */
|
/* XUL */
|
||||||
--zen-main-browser-background: light-dark(rgb(235, 235, 235), #1b1b1b);
|
--zen-main-browser-background: light-dark(rgb(235, 235, 235), #1b1b1b);
|
||||||
--zen-browser-gradient-base: color-mix(in srgb, var(--zen-primary-color) 50%, white 50%);
|
--zen-browser-gradient-base: color-mix(in srgb, var(--zen-primary-color) 50%, white 50%);
|
||||||
|
@@ -11,8 +11,11 @@
|
|||||||
* FOR ANY WEBSITE THAT WOULD NEED TO USE THE ACCENT COLOR, ETC
|
* FOR ANY WEBSITE THAT WOULD NEED TO USE THE ACCENT COLOR, ETC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const kZenThemeAccentColorPref = "zen.theme.accent-color";
|
const kZenThemePrefsList = [
|
||||||
const kZenThemeBorderRadiusPref = "zen.theme.border-radius";
|
"zen.theme.accent-color",
|
||||||
|
"zen.theme.border-radius",
|
||||||
|
"zen.theme.content-element-separation",
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ZenThemeModifier controls the application of theme data to the browser,
|
* ZenThemeModifier controls the application of theme data to the browser,
|
||||||
@@ -40,8 +43,17 @@ var ZenThemeModifier = {
|
|||||||
listenForEvents() {
|
listenForEvents() {
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
|
||||||
|
|
||||||
Services.prefs.addObserver(kZenThemeAccentColorPref, this.handleEvent.bind(this));
|
var handleEvent = this.handleEvent.bind(this);
|
||||||
Services.prefs.addObserver(kZenThemeBorderRadiusPref, this.handleEvent.bind(this));
|
// Listen for changes in the accent color and border radius
|
||||||
|
for (let pref of kZenThemePrefsList) {
|
||||||
|
Services.prefs.addObserver(pref, handleEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("unload", () => {
|
||||||
|
for (let pref of kZenThemePrefsList) {
|
||||||
|
Services.prefs.removeObserver(pref, handleEvent);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEvent(event) {
|
handleEvent(event) {
|
||||||
@@ -52,21 +64,27 @@ var ZenThemeModifier = {
|
|||||||
/**
|
/**
|
||||||
* Update all theme basics, like the accent color.
|
* Update all theme basics, like the accent color.
|
||||||
*/
|
*/
|
||||||
updateAllThemeBasics() {
|
async updateAllThemeBasics() {
|
||||||
this.updateAccentColor();
|
this.updateAccentColor();
|
||||||
this.updateBorderRadius();
|
this.updateBorderRadius();
|
||||||
|
this.updateElementSeparation();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateBorderRadius() {
|
updateBorderRadius() {
|
||||||
const borderRadius = Services.prefs.getIntPref(kZenThemeBorderRadiusPref, 4);
|
const borderRadius = Services.prefs.getIntPref("zen.theme.border-radius");
|
||||||
document.documentElement.style.setProperty("--zen-border-radius", borderRadius + "px");
|
document.documentElement.style.setProperty("--zen-border-radius", borderRadius + "px");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateElementSeparation() {
|
||||||
|
const separation = Services.prefs.getIntPref("zen.theme.content-element-separation");
|
||||||
|
document.documentElement.style.setProperty("--zen-element-separation", separation + "px");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the accent color.
|
* Update the accent color.
|
||||||
*/
|
*/
|
||||||
updateAccentColor() {
|
updateAccentColor() {
|
||||||
const accentColor = Services.prefs.getStringPref(kZenThemeAccentColorPref, "#0b57d0");
|
const accentColor = Services.prefs.getStringPref("zen.theme.accent-color");
|
||||||
document.documentElement.style.setProperty("--zen-primary-color", accentColor);
|
document.documentElement.style.setProperty("--zen-primary-color", accentColor);
|
||||||
// Notify the page that the accent color has changed, only if a function
|
// Notify the page that the accent color has changed, only if a function
|
||||||
// handler is defined.
|
// handler is defined.
|
||||||
|
Reference in New Issue
Block a user