feat: Make gradient attributes trigger less re-styles, b=bug #12765, c=common

This commit is contained in:
mr. m
2026-03-14 10:21:32 +01:00
parent 7dbe5b414d
commit 42ac8e6094
2 changed files with 9 additions and 8 deletions

View File

@@ -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%;

View File

@@ -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"
);
}
);
}