mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 00:10:00 +02:00
feat: Fix aligment issues with initial gradient text, b=no-bug, c=common, workspaces
This commit is contained in:
parent
fe77048619
commit
12ae2daeba
3 changed files with 10 additions and 5 deletions
|
@ -47,9 +47,7 @@
|
|||
|
||||
isolation: isolate;
|
||||
|
||||
:root[zen-should-be-dark-mode] {
|
||||
background: var(--zen-themed-toolbar-bg-transparent);
|
||||
}
|
||||
background: var(--zen-themed-toolbar-bg-transparent);
|
||||
|
||||
&::after,
|
||||
&::before {
|
||||
|
|
|
@ -1381,6 +1381,10 @@
|
|||
browser.gZenThemePicker.currentOpacity = workspaceTheme.opacity ?? 0.5;
|
||||
browser.gZenThemePicker.currentTexture = workspaceTheme.texture ?? 0;
|
||||
|
||||
const dominantColor = this.getMostDominantColor(workspaceTheme.gradientColors);
|
||||
const isDefaultTheme =
|
||||
dominantColor?.toString() === this.hexToRgb(this.getNativeAccentColor()).toString();
|
||||
|
||||
const opacitySlider = browser.document.getElementById(
|
||||
'PanelUI-zen-gradient-generator-opacity'
|
||||
);
|
||||
|
@ -1400,6 +1404,9 @@
|
|||
} else {
|
||||
opacity = (opacity - 0.15) / (0.85 - 0.15);
|
||||
}
|
||||
if (isDefaultTheme) {
|
||||
opacity = 1; // If it's the default theme, we want the wave to be
|
||||
}
|
||||
// Since it's sine waves, we can't just set the offset to the opacity, we need to calculate it
|
||||
// The offset is the percentage of the wave that is visible, so we need to multiply
|
||||
// the opacity by 100 to get the percentage.
|
||||
|
@ -1484,7 +1491,6 @@
|
|||
gradient
|
||||
);
|
||||
|
||||
const dominantColor = this.getMostDominantColor(workspaceTheme.gradientColors);
|
||||
if (dominantColor) {
|
||||
browser.document.documentElement.style.setProperty(
|
||||
'--zen-primary-color',
|
||||
|
@ -1493,7 +1499,7 @@
|
|||
: `rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]})`
|
||||
);
|
||||
let isDarkMode = this.isDarkMode;
|
||||
if (dominantColor.toString() !== this.hexToRgb(this.getNativeAccentColor()).toString()) {
|
||||
if (!isDefaultTheme) {
|
||||
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
|
||||
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
|
||||
} else {
|
||||
|
|
|
@ -300,6 +300,7 @@
|
|||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
font-size: small;
|
||||
margin: 0;
|
||||
|
||||
&[hidden] {
|
||||
display: none;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue