Skip to content

Commit 3c5adde

Browse files
committed
Fix dialog backdrop opacity on popups
1 parent ac963be commit 3c5adde

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/scss/main.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/* variables (mainly for colors) */
22
$brown-border: rgb(121, 77, 46);
33
$colored-container: rgb(255, 243, 209);
4-
$dialog-backdrop-opacity: 50%; /* default value for dialog opacity if something goes wrong (and for simple popups :D) */
4+
5+
// non-SCSS variables that are used for anything that needs to be modified programmatically
6+
:root {
7+
--dialog-backdrop-opacity: 50%; /* default value for dialog opacity if something goes wrong (and for simple popups :D) */
8+
}
59

610
@use "buildings.scss";
711

@@ -27,7 +31,7 @@ body {
2731

2832
/* no select for images */
2933
-webkit-user-drag: none;
30-
-webkit-touch-callout: none; /* yes its a mobile thing in the desktop version but its here anyway in case mobile breaks idk */
34+
-webkit-touch-callout: none; /* mobile-only */
3135
}
3236

3337
/* todo 0.7.1: find why these are here and how we can make their elements assigned to their own specific class instead of making every element have these properties*/
@@ -367,7 +371,7 @@ small {
367371
dialog::backdrop {
368372
background-color: black;
369373
opacity: 50%;
370-
opacity: $dialog-backdrop-opacity; /* for programmatic modification todo: fix */
374+
opacity: var(--dialog-backdrop-opacity); /* for programmatic modification */
371375
}
372376
.simple-popup-button-div {
373377
display: flex;

src/ts/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class AdvancedPopup {
110110
};
111111

112112
this.html.style.padding = filledOptions.innerPadding+"px";
113-
this.html.style.setProperty("--dialog-backdrop-opacity", filledOptions.filterLevel+"%"); // todo ASAP: fix
113+
this.html.style.setProperty("--dialog-backdrop-opacity", filledOptions.filterLevel+"%");
114114

115115
document.body.appendChild(this.html);
116116

0 commit comments

Comments
 (0)