mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-08 19:06:38 +00:00
Remove animation attribute when not animating and enhance toolbar color mixing logic for dark mode
This commit is contained in:
@@ -179,6 +179,8 @@ var gZenCompactModeManager = {
|
|||||||
});
|
});
|
||||||
}, 400);
|
}, 400);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.sidebar.removeAttribute("animate"); // remove the attribute if we are not animating
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@@ -497,11 +497,17 @@
|
|||||||
this.updateCurrentWorkspace();
|
this.updateCurrentWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getToolbarModifiedBase() {
|
||||||
|
return this.isDarkMode ?
|
||||||
|
'color-mix(in srgb, var(--zen-themed-toolbar-bg) 70%, #fff 30%)'
|
||||||
|
: 'color-mix(in srgb, var(--zen-themed-toolbar-bg) 95%, #000 5%)';
|
||||||
|
}
|
||||||
|
|
||||||
getSingleRGBColor(color, forToolbar = false) {
|
getSingleRGBColor(color, forToolbar = false) {
|
||||||
if (color.isCustom) {
|
if (color.isCustom) {
|
||||||
return color.c;
|
return color.c;
|
||||||
}
|
}
|
||||||
const toolbarBg = forToolbar ? 'var(--zen-themed-toolbar-bg)' : 'var(--zen-themed-toolbar-bg-transparent)';
|
const toolbarBg = forToolbar ? this.getToolbarModifiedBase() : 'var(--zen-themed-toolbar-bg-transparent)';
|
||||||
return `color-mix(in srgb, rgb(${color.c[0]}, ${color.c[1]}, ${color.c[2]}) ${this.currentOpacity * 100}%, ${toolbarBg} ${(1 - this.currentOpacity) * 100}%)`;
|
return `color-mix(in srgb, rgb(${color.c[0]}, ${color.c[1]}, ${color.c[2]}) ${this.currentOpacity * 100}%, ${toolbarBg} ${(1 - this.currentOpacity) * 100}%)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user