bugfix(z-index): Fixed several z-index problems, progress-bar inside nya deltagare is now hidden behind the header when scrolling. (TV-551)

Squashed commit of the following:

commit 87b53c3d03f71b5cfd6e632e39a3f2723deecdee
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Sep 16 10:57:12 2021 +0200

    Fixed issue with z-indexes
This commit is contained in:
Erik Tiekstra
2021-09-16 11:04:25 +02:00
parent bc8b09d0dc
commit ded0b83935
18 changed files with 62 additions and 24 deletions

View File

@@ -1,9 +1,10 @@
@import 'mixins/list'; @import 'mixins/list';
@import 'variables/z-index';
.toast-list { .toast-list {
position: fixed; position: fixed;
pointer-events: none; pointer-events: none;
z-index: 9999; z-index: $msfa__z-index-toast;
margin: var(--digi--layout--gutter); margin: var(--digi--layout--gutter);
top: 0; top: 0;
right: 0; right: 0;

View File

@@ -2,6 +2,8 @@
@import 'variables/gutters'; @import 'variables/gutters';
.employee-form { .employee-form {
position: relative;
&__header { &__header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@@ -1,5 +1,5 @@
<div class="employees-list"> <div class="employees-list">
<msfa-loader *ngIf="employeesLoading" [fullScreen]="true"></msfa-loader> <msfa-loader *ngIf="employeesLoading" type="absolute"></msfa-loader>
<digi-table af-variation="secondary"> <digi-table af-variation="secondary">
<table> <table>
<thead> <thead>

View File

@@ -1,4 +1,5 @@
@import 'variables/gutters'; @import 'variables/gutters';
@import 'variables/z-index';
.avrop { .avrop {
&__header { &__header {
@@ -16,6 +17,10 @@
margin-bottom: $digi--layout--gutter--xl; margin-bottom: $digi--layout--gutter--xl;
} }
&__progress-bar {
z-index: $msfa__z-index-default;
}
&__select-handledare { &__select-handledare {
max-width: var(--digi--typography--text--max-width); max-width: var(--digi--typography--text--max-width);
margin-bottom: $digi--layout--gutter--xl; margin-bottom: $digi--layout--gutter--xl;

View File

@@ -3,7 +3,6 @@
<section class="start"> <section class="start">
<header class="start__header"> <header class="start__header">
<div class="start__image-wrapper"> <div class="start__image-wrapper">
<h1 class="start__heading">Välkommen {{ userFullName$ | async }}</h1>
<digi-media-image <digi-media-image
af-src="/assets/images/start_1280w.jpg" af-src="/assets/images/start_1280w.jpg"
af-srcset=" af-srcset="
@@ -15,6 +14,7 @@
af-width="1000" af-width="1000"
af-height="465" af-height="465"
></digi-media-image> ></digi-media-image>
<h1 class="start__heading">Välkommen {{ userFullName$ | async }}</h1>
</div> </div>
<ng-container *ngIf="isAuthorizedUser(userRoles); else unauthorizedRef"> <ng-container *ngIf="isAuthorizedUser(userRoles); else unauthorizedRef">
<p> <p>
@@ -36,5 +36,5 @@
</msfa-layout> </msfa-layout>
<ng-template #loadingRef> <ng-template #loadingRef>
<msfa-loader [fullScreen]="true"></msfa-loader> <msfa-loader type="full-screen"></msfa-loader>
</ng-template> </ng-template>

View File

@@ -15,6 +15,5 @@
background-color: var(--digi--ui--color--complementary-alt); background-color: var(--digi--ui--color--complementary-alt);
color: var(--digi--typography--color--text--light); color: var(--digi--typography--color--text--light);
padding: $digi--layout--gutter--s $digi--layout--gutter--l; padding: $digi--layout--gutter--s $digi--layout--gutter--l;
z-index: 1;
} }
} }

View File

@@ -1,14 +1,15 @@
@import 'mixins/list';
@import 'variables/colors'; @import 'variables/colors';
@import 'variables/gutters'; @import 'variables/gutters';
@import 'variables/navigation'; @import 'variables/navigation';
@import 'mixins/list'; @import 'variables/z-index';
.sidebar { .sidebar {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: sticky; position: sticky;
top: $msfa__navigation-height; top: $msfa__navigation-height;
z-index: 1; z-index: $msfa__z-index-sidebar;
&__list { &__list {
@include msfa__reset-list; @include msfa__reset-list;

View File

@@ -1,4 +1,5 @@
@import 'variables/colors'; @import 'variables/colors';
@import 'variables/z-index';
.skip-to-content { .skip-to-content {
position: absolute; position: absolute;
@@ -8,7 +9,7 @@
width: 0; width: 0;
height: 0; height: 0;
overflow: hidden; overflow: hidden;
z-index: 1000; z-index: $msfa__z-index-skip-to-content;
text-align: center; text-align: center;
padding: var(--digi--layout--gutter--xs) var(--digi--layout--gutter); padding: var(--digi--layout--gutter--xs) var(--digi--layout--gutter);
display: block; display: block;

View File

@@ -19,4 +19,4 @@
<msfa-footer class="msfa__footer"></msfa-footer> <msfa-footer class="msfa__footer"></msfa-footer>
</div> </div>
<msfa-loader *ngIf="(userLoading$ | async) || (rolesLoading$ | async)" [fullScreen]="true"></msfa-loader> <msfa-loader *ngIf="(userLoading$ | async) || (rolesLoading$ | async)" type="full-screen"></msfa-loader>

View File

@@ -1,6 +1,7 @@
@import 'variables/navigation';
@import 'variables/breakpoints'; @import 'variables/breakpoints';
@import 'variables/gutters'; @import 'variables/gutters';
@import 'variables/navigation';
@import 'variables/z-index';
.msfa { .msfa {
position: relative; position: relative;
@@ -17,7 +18,7 @@
grid-area: header; grid-area: header;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1; z-index: $msfa__z-index-header;
} }
&__sidebar { &__sidebar {

View File

@@ -1,4 +1,5 @@
@import 'mixins/backdrop'; @import 'mixins/backdrop';
@import 'variables/z-index';
@keyframes spinning { @keyframes spinning {
to { to {
@@ -11,8 +12,12 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&--absolute {
@include msfa__backdrop($msfa__z-index-backdrop, false);
}
&--full-screen { &--full-screen {
@include msfa__backdrop(1000); @include msfa__backdrop($msfa__z-index-backdrop);
} }
&__spinner { &__spinner {

View File

@@ -1,4 +1,5 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { LoaderType } from '@msfa-enums/loader-type.enum';
@Component({ @Component({
selector: 'msfa-loader', selector: 'msfa-loader',
@@ -8,11 +9,11 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
}) })
export class LoaderComponent { export class LoaderComponent {
private readonly _defaultClass = 'loader'; private readonly _defaultClass = 'loader';
@Input() fullScreen = false; @Input() type: LoaderType;
get classes(): string { get classes(): string {
if (this.fullScreen) { if (this.type) {
return `${this._defaultClass} ${this._defaultClass}--full-screen`; return `${this._defaultClass} ${this._defaultClass}--${this.type as string}`;
} }
return this._defaultClass; return this._defaultClass;
} }

View File

@@ -30,7 +30,6 @@
&__clear-btn { &__clear-btn {
position: absolute; position: absolute;
z-index: 20;
right: 0; right: 0;
top: 0; top: 0;
display: block; display: block;

View File

@@ -1,11 +1,11 @@
@import 'variables/colors';
@import 'mixins/list'; @import 'mixins/list';
@import 'variables/colors';
@import 'variables/gutters'; @import 'variables/gutters';
@import 'variables/z-index';
.tree-nodes-selector { .tree-nodes-selector {
&__panel-wrapper { &__panel-wrapper {
position: relative; position: relative;
z-index: 1;
} }
&__toggle-panel-btn { &__toggle-panel-btn {
@@ -21,7 +21,6 @@
font-size: var(--digi--typography--font-size--m); font-size: var(--digi--typography--font-size--m);
color: var(--digi--ui--color--background--overlay--opaque); color: var(--digi--ui--color--background--overlay--opaque);
background-color: var(--digi--ui--color--background); background-color: var(--digi--ui--color--background);
z-index: 1;
&:focus { &:focus {
border-color: var(--digi--ui--color--focus--light); border-color: var(--digi--ui--color--focus--light);
@@ -60,7 +59,7 @@
&__panel { &__panel {
position: absolute; position: absolute;
z-index: 10; z-index: $msfa__z-index-selector-panel;
top: 100%; top: 100%;
left: 0; left: 0;
margin-top: $digi--layout--gutter--xs; margin-top: $digi--layout--gutter--xs;

View File

@@ -0,0 +1,4 @@
export enum LoaderType {
FULL_SCREEN = 'fullscreen',
ABSOLUTE = 'absolute',
}

View File

@@ -1,9 +1,16 @@
@mixin msfa__backdrop($zIndex: 0) { @import 'variables/z-index';
position: absolute;
@mixin msfa__backdrop($zIndex: $msfa__z-index-default, $fullScreen: true) {
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: $zIndex; z-index: $zIndex;
background-color: rgba(255, 255, 255, 0.4); background-color: rgba(255, 255, 255, 0.4);
@if $fullScreen {
position: fixed;
} @else {
position: absolute;
}
} }

View File

@@ -3,6 +3,7 @@
@import 'mixins/backdrop'; @import 'mixins/backdrop';
@import 'mixins/icon'; @import 'mixins/icon';
@import 'mixins/link'; @import 'mixins/link';
@import 'variables/z-index';
* { * {
font-family: var(--digi--typography--font-family); font-family: var(--digi--typography--font-family);
@@ -65,7 +66,11 @@ dl {
} }
&__backdrop { &__backdrop {
@include msfa__backdrop; @include msfa__backdrop($msfa__z-index-default, false);
&--full-screen {
@include msfa__backdrop($msfa__z-index-backdrop);
}
} }
&__digi-icon { &__digi-icon {

View File

@@ -0,0 +1,8 @@
$msfa__z-index-default: 0;
$msfa__z-index-header: 1;
$msfa__z-index-sidebar: 1;
$msfa__z-index-footer: 0;
$msfa__z-index-selector-panel: 1;
$msfa__z-index-backdrop: 1000;
$msfa__z-index-skip-to-content: 2;
$msfa__z-index-toast: 9999;