mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-30 04:11:51 +00:00
feat: Make gradient attributes trigger less re-styles, b=bug #12765, c=common
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
:root[zen-show-grainy-background="true"] & .zen-browser-grain {
|
||||
&[zen-show-grainy-background="true"] .zen-browser-grain {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -1438,13 +1438,14 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
updateNoise(texture) {
|
||||
document.documentElement.style.setProperty(
|
||||
"--zen-grainy-background-opacity",
|
||||
texture
|
||||
);
|
||||
document.documentElement.setAttribute(
|
||||
"zen-show-grainy-background",
|
||||
texture > 0 ? "true" : "false"
|
||||
[lazy.browserBackgroundElement, lazy.toolbarBackgroundElement].forEach(
|
||||
element => {
|
||||
element.style.setProperty("--zen-grainy-background-opacity", texture);
|
||||
element.setAttribute(
|
||||
"zen-show-grainy-background",
|
||||
texture > 0 ? "true" : "false"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user