Skip to content

Commit

Permalink
refactor: switch to layering system variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vladjerca authored and seferturan committed Feb 10, 2025
1 parent 35263ef commit 7cbc47b
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@use "$style/scss/mixins/index" as *;
.background-cover-image {
z-index: -1;
z-index: var(--layer-background);
position: absolute;
max-height: 100dvh;
overflow: hidden;
Expand Down
3 changes: 1 addition & 2 deletions projects/client/src/lib/components/buttons/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,11 @@
p,
.button-label,
.button-icon {
z-index: 1;
z-index: var(--layer-base);
}
&::before {
content: "";
z-index: 0;
position: absolute;
top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
:global(.trakt-popup-menu-container) {
--list-padding: var(--ni-8);
z-index: 777;
z-index: var(--layer-menu);
position: absolute;
min-width: var(--ni-156);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const createUnderlay = () => {
underlay.style.width = '100%';
underlay.style.height = '100%';

underlay.style.zIndex = '777';
underlay.style.zIndex = 'calc(var(--layer-menu) - 1)';

return underlay;
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
top: 0;
right: 0;
left: 0;
z-index: 3;
z-index: var(--layer-floating);
:global(.trakt-popup-menu-button) {
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions projects/client/src/lib/components/card/CardCover.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
position: absolute;
padding: var(--padding-card-tag);
z-index: 2;
z-index: var(--layer-raised);
bottom: 0;
left: 0;
Expand Down Expand Up @@ -92,7 +92,7 @@
width: var(--width-card);
height: var(--ni-40);
flex-shrink: 0;
z-index: 1;
z-index: var(--layer-base);
background: linear-gradient(
180deg,
Expand Down
27 changes: 13 additions & 14 deletions projects/client/src/lib/components/dropdown/DropdownList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
}}
data-size={size}
>
{#if $isDropdownOpen}
<div class="trakt-list" transition:slide={{ duration: 150 }}>
<div class="spacer"></div>
<ul onclickcapture={() => isDropdownOpen.set(false)}>
{@render items()}
</ul>
</div>
{/if}

<Button
onclick={(ev) => {
isDropdownOpen.update((state) => !state);
Expand All @@ -45,15 +54,6 @@
</div>
{/snippet}
</Button>

{#if $isDropdownOpen}
<div class="trakt-list" transition:slide={{ duration: 150 }}>
<div class="spacer"></div>
<ul onclickcapture={() => isDropdownOpen.set(false)}>
{@render items()}
</ul>
</div>
{/if}
</div>

<style lang="scss">
Expand Down Expand Up @@ -104,19 +104,18 @@
}
&.is-list-open {
z-index: 777;
z-index: var(--layer-menu);
:global(.trakt-button) {
z-index: 777;
z-index: var(--layer-menu);
}
.trakt-list {
z-index: 776;
opacity: 1;
}
.trakt-dropdown-list-icon {
z-index: 777;
z-index: var(--layer-menu);
}
}
Expand Down Expand Up @@ -154,7 +153,7 @@
.trakt-list {
--list-padding: var(--ni-12);
z-index: -1;
z-index: var(--layer-background);
position: absolute;
width: 100%;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
&::before,
&::after {
content: "";
z-index: 3;
z-index: var(--layer-floating);
pointer-events: none;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
container-type: inline-size;
.trakt-landing-media-wrapper {
z-index: 2;
z-index: var(--layer-raised);
display: grid;
width: 100%;
justify-content: center;
Expand All @@ -49,7 +49,7 @@
.trakt-landing-phones {
display: flex;
align-items: center;
z-index: 1;
z-index: var(--layer-base);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
bottom: 0;
left: 0;
right: 0;
z-index: 999;
z-index: var(--layer-overlay);
background-color: var(--color-background-mobile-navbar);
box-shadow: 0px -24px 64px 0px
Expand Down
2 changes: 1 addition & 1 deletion projects/client/src/lib/sections/navbar/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}
.trakt-navbar {
z-index: 999;
z-index: var(--layer-overlay);
position: fixed;
top: 0;
left: var(--layout-distance-side);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
:global(.vip-badge) {
margin-left: var(--ni-neg-8);
z-index: 1;
z-index: var(--layer-raised);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
left: 0;
top: 0;
width: var(--mobile-search-focus-width);
z-index: 666;
z-index: var(--layer-top);
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@
--search-side-distance: var(--ni-32);
content: "";
z-index: 777;
z-index: var(--layer-overlay);
width: calc(var(--search-input-width) - var(--search-side-distance));
height: var(--ni-2);
Expand Down Expand Up @@ -176,7 +176,7 @@
}
.trakt-search-results {
z-index: 999;
z-index: var(--layer-overlay);
position: absolute;
top: 120%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
align-items: center;
:global(.trakt-vip-badge) {
z-index: 2;
z-index: var(--layer-base);
margin-top: var(--ni-neg-16);
}
Expand Down
2 changes: 1 addition & 1 deletion projects/client/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
@mixin pwa-navbar-shadow($position) {
content: "";
z-index: 3;
z-index: var(--layer-floating);
pointer-events: none;
position: $position;
Expand Down

0 comments on commit 7cbc47b

Please sign in to comment.