Refactor initialization scripts and update CSS variables for consistent styling across components

This commit is contained in:
mr. M
2025-01-19 13:00:27 +01:00
parent 09d17f2cfe
commit 25910c5189
11 changed files with 26 additions and 47 deletions

View File

@@ -11,7 +11,7 @@
"start": "cd engine && ./mach run --noprofile", "start": "cd engine && ./mach run --noprofile",
"import": "surfer import", "import": "surfer import",
"export": "surfer export", "export": "surfer export",
"init": "npm run bootstrap && npm run import", "init": "npm run download && npm run bootstrap && npm run import",
"download": "surfer download", "download": "surfer download",
"bootstrap": "surfer bootstrap && surfer bootstrap", "bootstrap": "surfer bootstrap && surfer bootstrap",
"package": "surfer package", "package": "surfer package",

View File

@@ -102,14 +102,10 @@ pref('zen.injections.match-urls', 'http://localhost/*', locked);
pref('zen.rice.share.notice.accepted', false); pref('zen.rice.share.notice.accepted', false);
#ifdef XP_MACOSX #ifdef XP_MACOSX
pref('zen.theme.border-radius', 10); // In pixels pref('zen.theme.border-radius', 11); // In pixels
#else
#ifdef XP_WIN
pref('zen.theme.border-radius', 6); // In pixels
#else #else
pref('zen.theme.border-radius', 8); // In pixels pref('zen.theme.border-radius', 8); // In pixels
#endif #endif
#endif
pref('zen.theme.color-prefs.use-workspace-colors', true); pref('zen.theme.color-prefs.use-workspace-colors', true);
pref('zen.theme.color-prefs.amoled', false); pref('zen.theme.color-prefs.amoled', false);

View File

@@ -211,6 +211,7 @@ var gZenVerticalTabsManager = {
this.__actualWindowButtons = !this.isWindowsStyledButtons this.__actualWindowButtons = !this.isWindowsStyledButtons
? document.querySelector('.titlebar-buttonbox-container') // TODO: test if it works 100% of the time ? document.querySelector('.titlebar-buttonbox-container') // TODO: test if it works 100% of the time
: document.querySelector('#nav-bar .titlebar-buttonbox-container'); : document.querySelector('#nav-bar .titlebar-buttonbox-container');
this.__actualWindowButtons.setAttribute('overflows', 'false');
} }
return this.__actualWindowButtons; return this.__actualWindowButtons;
}, },

View File

@@ -7,14 +7,7 @@
& #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer { & #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
width: -moz-available; width: -moz-available;
--zen-native-content-radius: env(-moz-gtk-csd-titlebar-radius, var(--zen-border-radius)); --zen-native-content-radius: env(-moz-gtk-csd-titlebar-radius, var(--zen-border-radius));
border-radius: var( border-radius: var(--zen-native-inner-radius);
--zen-webview-border-radius,
/* Inner radius calculation:
* 1. If the native radius - the separation is less than 4px, use 4px.
* 2. Otherwise, use the the calculated value (inner radius = outer radius - separation).
*/
max(4px, calc(var(--zen-native-content-radius) - var(--zen-element-separation)))
);
position: relative; position: relative;
/* For glance */ /* For glance */
@@ -29,7 +22,7 @@
} }
:root:not([zen-no-padding='true']) & { :root:not([zen-no-padding='true']) & {
box-shadow: 0 0 9.73px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25)); box-shadow: var(--zen-big-shadow);
} }
} }

View File

@@ -149,6 +149,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
position: relative; position: relative;
gap: var(--zen-element-separation);
} }
.titlebar-buttonbox-container { .titlebar-buttonbox-container {

View File

@@ -53,7 +53,7 @@
menupopup, menupopup,
panel { panel {
--panel-background: var(--arrowpanel-background); --panel-background: var(--arrowpanel-background);
--panel-border-radius: var(--zen-panel-radius); --panel-border-radius: var(--zen-native-inner-radius);
} }
/* app menu */ /* app menu */

View File

@@ -15,7 +15,7 @@
#zen-rice-share-dialog-notice { #zen-rice-share-dialog-notice {
color: var(--panel-color); color: var(--panel-color);
background: var(--arrowpanel-background); background: var(--arrowpanel-background);
border-radius: var(--zen-panel-radius); border-radius: var(--zen-native-inner-radius);
box-shadow: 0 0 1px 1px hsla(0, 0%, 0%, 0.2); box-shadow: 0 0 1px 1px hsla(0, 0%, 0%, 0.2);
border: var(--zen-appcontent-border); border: var(--zen-appcontent-border);
overflow: hidden; overflow: hidden;
@@ -130,7 +130,7 @@
background: rgba(255, 0, 0, 0.1); background: rgba(255, 0, 0, 0.1);
padding: 5px; padding: 5px;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
border-radius: var(--zen-panel-radius); border-radius: var(--zen-native-inner-radius);
@starting-style { @starting-style {
opacity: 0; opacity: 0;

View File

@@ -63,6 +63,7 @@
max-width: 0; max-width: 0;
padding: 0; padding: 0;
margin: 0; margin: 0;
display: none;
} }
#zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel[pinned='true']) { #zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel[pinned='true']) {
@@ -79,9 +80,9 @@
} }
#zen-sidebar-web-panel { #zen-sidebar-web-panel {
border-radius: var(--zen-panel-radius); border-radius: var(--zen-native-inner-radius);
z-index: 2; z-index: 2;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: var(--zen-big-shadow);
border: 1px solid var(--zen-colors-border); border: 1px solid var(--zen-colors-border);
background: var(--zen-colors-tertiary); background: var(--zen-colors-tertiary);
opacity: 0; opacity: 0;
@@ -182,10 +183,6 @@
display: flex; display: flex;
} }
#zen-sidebar-web-panel-wrapper {
margin: 0 calc(var(--zen-element-separation) / 2) 0 var(--zen-element-separation);
}
#zen-sidebar-web-panel[pinned='true'] { #zen-sidebar-web-panel[pinned='true'] {
position: absolute; position: absolute;
z-index: 1; z-index: 1;
@@ -289,19 +286,6 @@
animation: better-sidebar-pinned-hide 0.15s ease-in-out forwards !important; animation: better-sidebar-pinned-hide 0.15s ease-in-out forwards !important;
} }
#zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel:not([hidden='true'])) {
:root:not([zen-right-side='true']) & {
margin-right: calc(var(--zen-element-separation) * 2 - 3px) !important;
}
@media (-moz-bool-pref: 'zen.view.compact') and (-moz-bool-pref: 'zen.view.compact.hide-tabbar') {
:root[zen-right-side='true'] & {
margin-left: 0 !important;
margin-right: calc(var(--zen-element-separation) * 2 - 3px) !important;
}
}
}
/** UNPINNED **/ /** UNPINNED **/
#zen-sidebar-web-panel { #zen-sidebar-web-panel {
/* Sets perspective */ /* Sets perspective */

View File

@@ -383,15 +383,10 @@
padding-right: 0; padding-right: 0;
:root[zen-single-toolbar='true'] & { :root[zen-single-toolbar='true'] & {
margin-left: var(--zen-toolbox-padding);
& #urlbar:not([breakout-extend='true']) .urlbar-input-container { & #urlbar:not([breakout-extend='true']) .urlbar-input-container {
padding-left: 4px; padding-left: 4px;
padding-right: 4px; padding-right: 4px;
} }
:root[zen-right-side='true'] & {
margin-left: 0;
}
} }
} }
@@ -445,10 +440,8 @@
&:not([zen-right-side='true']) { &:not([zen-right-side='true']) {
padding-right: 0; padding-right: 0;
& #titlebar {
padding-left: var(--zen-toolbox-padding); padding-left: var(--zen-toolbox-padding);
} }
}
& #TabsToolbar-customization-target { & #TabsToolbar-customization-target {
&::after { &::after {

View File

@@ -126,7 +126,6 @@
--browser-area-z-index-toolbox: 2 !important; --browser-area-z-index-toolbox: 2 !important;
--zen-appcontent-border: 1px solid var(--zen-colors-border); --zen-appcontent-border: 1px solid var(--zen-colors-border);
--zen-panel-radius: var(--zen-border-radius);
--toolbarbutton-border-radius: 6px; --toolbarbutton-border-radius: 6px;
--urlbar-margin-inline: 1px !important; --urlbar-margin-inline: 1px !important;
@@ -169,6 +168,18 @@
--arrowpanel-background: var(--zen-dialog-background) !important; --arrowpanel-background: var(--zen-dialog-background) !important;
--tab-selected-shadow: 0 0 1px 0px rgba(0, 0, 0, 0.1) !important; --tab-selected-shadow: 0 0 1px 0px rgba(0, 0, 0, 0.1) !important;
--zen-big-shadow: 0 0 9.73px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25));
/* Nativity */
--zen-native-content-radius: env(-moz-gtk-csd-titlebar-radius, var(--zen-border-radius));
--zen-native-inner-radius: var(
--zen-webview-border-radius,
/* Inner radius calculation:
* 1. If the native radius - the separation is less than 4px, use 4px.
* 2. Otherwise, use the the calculated value (inner radius = outer radius - separation).
*/
max(4px, calc(var(--zen-native-content-radius) - var(--zen-element-separation)))
);
/** Other theme-related styles */ /** Other theme-related styles */
font-family: font-family:

View File

@@ -35,7 +35,7 @@
border: none !important; border: none !important;
margin: 1px; margin: 1px;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1) !important; box-shadow: var(--zen-big-shadow) !important;
:root[zen-single-toolbar='true'] & { :root[zen-single-toolbar='true'] & {
box-shadow: none !important; box-shadow: none !important;
} }