From 51d57729ca3cd3db3e245278e12e421ed35a14ae Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 28 Dec 2022 22:07:11 +0100 Subject: [PATCH] Create `--b-panel-opacity` property --- src/rulesets/glass.less | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rulesets/glass.less b/src/rulesets/glass.less index 3b0b708..23cbdb0 100644 --- a/src/rulesets/glass.less +++ b/src/rulesets/glass.less @@ -7,20 +7,23 @@ & { // Sets the backdrop-filter blur radius of all panels --b-panel-blur: 16px; + + // Set the opacity of the glass panels + --b-panel-opacity: 0.075; } // Ensure that browsers not supporting backdrop-filter do not apply this style @supports (backdrop-filter: blur(var(--b-panel-blur))) { @{panel}, @{table}@{panel} > @{table-caption} { - background-color: .hsl-group(background; 0.3)[@c]; + background-color: .hsl-group(background; calc(4 * var(--b-panel-opacity)))[@c]; backdrop-filter: blur(var(--b-panel-blur)) hue-rotate(calc(var(--bhsl-current-hue) - var(--bhsl-foreground-hue))) ; @{panel} { - background-color: .hsl-group(current; 0.075)[@c]; + background-color: .hsl-group(current; var(--b-panel-opacity))[@c]; backdrop-filter: none; } }