Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Manage z-indexes in variables

Rigel Kent36f2981f7d58
diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss
index 51a7a3dd1d..7a6710829e 100644
--- a/client/src/app/app.component.scss
+++ b/client/src/app/app.component.scss
@@ -16,12 +16,12 @@
top: 0;
width: 100%;
background-color: var(--mainBackgroundColor);
- z-index: 1000;
+ z-index: z(header);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
display: flex;
.top-left-block {
- z-index: 1001;
+ z-index: z(headerLeft);
height: $header-height;
display: flex;
align-items: center;
diff --git a/client/src/app/core/hotkeys/hotkeys.component.scss b/client/src/app/core/hotkeys/hotkeys.component.scss
index 3aa0b62526..02c8c59aa7 100644
--- a/client/src/app/core/hotkeys/hotkeys.component.scss
+++ b/client/src/app/core/hotkeys/hotkeys.component.scss
@@ -1,3 +1,5 @@
+@import '_mixins';
+
.cfp-hotkeys-container {
display: flex !important;
align-items: center;
@@ -23,7 +25,7 @@
}
.cfp-hotkeys-container.fade.in {
- z-index: 10002;
+ z-index: z(hotkeys);
visibility: visible;
opacity: 1;
}
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss
index dd718a0918..43654504c4 100644
--- a/client/src/app/menu/menu.component.scss
+++ b/client/src/app/menu/menu.component.scss
@@ -6,7 +6,7 @@
height: calc(100vh - #{$header-height});
padding: 0;
width: $menu-width;
- z-index: 11000;
+ z-index: z(menu);
}
menu {
diff --git a/client/src/sass/bootstrap.scss b/client/src/sass/bootstrap.scss
index 035270e89f..a17d9c048e 100644
--- a/client/src/sass/bootstrap.scss
+++ b/client/src/sass/bootstrap.scss
@@ -19,7 +19,7 @@ $icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
}
.dropdown {
- z-index: 10001 !important;
+ z-index: z(dropdown) !important;
}
.dropdown-menu {
@@ -176,7 +176,11 @@ ngb-tabset.bootstrap {
}
ngb-modal-backdrop {
- z-index: 10000 !important;
+ z-index: z(modal) - 1 !important;
+}
+
+ngb-modal-window {
+ z-index: z(modal) !important;
}
.btn-outline-tertiary {
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index e087a25482..d0e1a8c9ca 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -93,8 +93,24 @@ $variables: (
--embedBigPlayBackgroundColor: var(--embedBigPlayBackgroundColor)
);
-/*** theme helper ***/
-
@function var($variable) {
@return map-get($variables, $variable);
}
+
+/*** z-index groups ***/
+
+$zindex: (
+ header : 1000,
+ /* header context */
+ headerLeft : 10,
+ menu : 11000,
+ dropdown : 12000,
+ loadbar : 13000,
+ modal : 14000,
+ notification : 15000,
+ hotkeys : 16000
+);
+
+@function z($label) {
+ @return map-get($zindex, $label);
+}
diff --git a/client/src/sass/loading-bar.scss b/client/src/sass/loading-bar.scss
index 7d687d479c..d584b7c67b 100644
--- a/client/src/sass/loading-bar.scss
+++ b/client/src/sass/loading-bar.scss
@@ -1,3 +1,4 @@
+@import '_mixins';
// Thanks: https://github.com/aitboudad/ngx-loading-bar/blob/master/loading-bar.css
/* Make clicks pass-through */
@@ -20,7 +21,7 @@
background: var(--mainColor);
position: fixed;
- z-index: 10002;
+ z-index: z(loadbar);
top: 0;
left: 0;
width: 100%;
@@ -50,7 +51,7 @@
#loading-bar-spinner {
display: block;
position: fixed;
- z-index: 10002;
+ z-index: z(loadbar);
top: 10px;
left: 10px;
}
diff --git a/client/src/sass/primeng-custom.scss b/client/src/sass/primeng-custom.scss
index 753fdf5c97..4d2d6cb676 100644
--- a/client/src/sass/primeng-custom.scss
+++ b/client/src/sass/primeng-custom.scss
@@ -383,8 +383,7 @@ p-inputswitch {
p-toast {
.ui-toast {
- // Modal is 10005
- z-index: 10010 !important;
+ z-index: z(notification) !important;
}
.ui-toast-message {