From 0988a24c3e1dbea4108b4547419f16c0917e5c16 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 30 Mar 2024 19:40:55 +0100 Subject: [PATCH] Add configurable panel opacity Closes #68. --- src/rulesets/base.less | 10 ++++++++-- src/rulesets/classic.less | 5 ++++- src/rulesets/glass.less | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/rulesets/base.less b/src/rulesets/base.less index e63582d..a2db164 100644 --- a/src/rulesets/base.less +++ b/src/rulesets/base.less @@ -63,7 +63,11 @@ height: 100%; // Set the default font family - .use-font-group(text) + .use-font-group(text); + + // Set the opacity of the glass panels + --b-panel-initial-opacity: 1.0; + --b-panel-nested-opacity: 1.0; } // @@ -209,7 +213,7 @@ gap: 8px; // Give the first panel in a stack a fixed background color, so it may be seen against a background - background-color: .hsl-group(background)[@c]; + background-color: .hsl-group(background; var(--b-panel-initial-opacity))[@c]; // Set a min-width for the first level panel @media (max-width: 492px) { @@ -248,6 +252,8 @@ // Do not set min-width for nested panels @{panel} { min-width: unset; + + background-color: .hsl-group(background; var(--b-panel-nested-opacity))[@c]; } } diff --git a/src/rulesets/classic.less b/src/rulesets/classic.less index dd8e70e..338fe5e 100644 --- a/src/rulesets/classic.less +++ b/src/rulesets/classic.less @@ -11,6 +11,9 @@ // Set the shadow drawn on element placed directly on the background --b-outer-shadow: 2px 2px 4px .hsl-group(background)[@c]; + + // Override the nested panel opacity to keep them readable + --b-panel-nested-opacity: 0.075; } &, @{all} { @@ -38,7 +41,7 @@ // Do not give the same effects to nested panels @{panel} { - background-color: .hsl-group(current; 0.075)[@c]; + background-color: .hsl-group(current; var(--b-panel-nested-opacity))[@c]; backdrop-filter: none; box-shadow: none; } diff --git a/src/rulesets/glass.less b/src/rulesets/glass.less index 29dcc96..cecf505 100644 --- a/src/rulesets/glass.less +++ b/src/rulesets/glass.less @@ -8,7 +8,7 @@ // Sets the backdrop-filter blur radius of all panels --b-panel-blur: 16px; - // Set the opacity of the glass panels + // Override the opacity of the glass panels --b-panel-initial-opacity: 0.300; --b-panel-nested-opacity: 0.075; }