Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organise CSS Z-index #2095

Merged
merged 9 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
flex-direction: column;
overflow-y: scroll;
position: absolute;
z-index: 3;
z-index: variables.$zindex-plot-modal;;
}

.pipeline-run-plots-modal__top {
Expand Down
10 changes: 5 additions & 5 deletions src/components/experiment-tracking/runs-list/runs-list.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '../../../styles/variables' as colors;
@use '../../../styles/variables' as variables;

.kui-theme--light {
--header-border-bottom: #{colors.$white-300};
--header-border-bottom: #{variables.$white-300};
}

.kui-theme--dark {
Expand All @@ -11,15 +11,15 @@
.runs-list-top-wrapper {
position: sticky;
top: 0;
z-index: 1;
z-index: variables.$zindex-sticky-elements;
}

.search-bar-wrapper {
background: var(--color-bg-2);
padding-top: 24px;
position: sticky;
top: 0;
z-index: 1;
z-index: variables.$zindex-sticky-elements;
}

.runs-list__wrapper {
Expand All @@ -40,7 +40,7 @@
padding: 3.5em 3.5em 1.2em 3em;
position: sticky;
top: 64px;
z-index: 1;
z-index: variables.$zindex-sticky-elements;
}

.compare-switch-wrapper__text {
Expand Down
25 changes: 12 additions & 13 deletions src/components/feature-hints/feature-hints.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@use '../../styles/variables' as colors;
@use '../../styles/variables' as variables;

.feature-hints {
background-color: colors.$yellow-0;
background-color: variables.$yellow-0;
bottom: 36px;
color: colors.$black-900;
color: variables.$black-900;
display: flex;
flex-direction: column;
height: auto;
padding: 32px 36px 36px;
position: absolute;
transition: height 0.3s ease-in-out, right ease 0.4s;
width: 365px;
z-index: 5;
z-index: variables.$zindex-feature-hints;

&__reopen-message {
font-size: 14px;
Expand All @@ -20,7 +20,7 @@
}

&__nav {
color: colors.$black-300;
color: variables.$black-300;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.024px;
Expand Down Expand Up @@ -69,17 +69,17 @@
}

.button button {
color: colors.$black-900;
border-color: colors.$black-900;
color: variables.$black-900;
border-color: variables.$black-900;

&:hover:not(.button__btn--secondary) {
background: colors.$black-900;
color: colors.$white-0;
background: variables.$black-900;
color: variables.$white-0;
}
}

.button__btn--secondary:hover::after {
background: colors.$black-900;
background: variables.$black-900;
}

.button__btn--secondary:active {
Expand All @@ -101,7 +101,6 @@
pointer-events: none;
position: absolute;
transform: translate(-50%, -50%);
transition: left 0.3s ease-in-out, top 0.3s ease-in-out,
opacity 0.1s ease-in-out;
z-index: 5;
transition: left 0.3s ease-in-out, top 0.3s ease-in-out, opacity 0.1s ease-in-out;
z-index: variables.$zindex-feature-hints;
}
2 changes: 1 addition & 1 deletion src/components/flowchart-wrapper/flowchart-wrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $sidebar-toolbar-width-open: variables.$sidebar-width-open +
opacity: 0;
pointer-events: none;
position: relative;
z-index: 3;
z-index: variables.$zindex-go-back-btn;

.button button {
background-color: variables.$yellow-300;
Expand Down
2 changes: 1 addition & 1 deletion src/components/global-toolbar/global-toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
position: absolute;
top: 0;
width: variables.$global-toolbar-width;
z-index: 5;
z-index: variables.$zindex-global-toolbar;
}

.pipeline-global-routes-toolbar {
Expand Down
2 changes: 1 addition & 1 deletion src/components/metadata-modal/metadata-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
height: 100%; /* Full height (cover the whole page) */
inset: 0 0 0 variables.$global-toolbar-width;
position: absolute;
z-index: 6;
z-index: variables.$zindex-metadata-modal;

/* We don't need full width as sometime the preview table can take up more than a width of the page */
background-color: var(--color-bg-plot);
Expand Down
2 changes: 1 addition & 1 deletion src/components/metadata/styles/metadata-code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
padding: 0 variables.$metadata-sidebar-width-open 0 0;
transform: translateX(100vw);
transition: transform ease 0.5s 0.1s, left ease 0.5s;
z-index: variables.$z-index-metadata-code;
z-index: variables.$zindex-metadata-code;

&--visible {
transform: translateX(variables.$global-toolbar-width);
Expand Down
4 changes: 2 additions & 2 deletions src/components/metadata/styles/metadata.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
top: -1px; /* Avoids pixel rounding gaps */
right: -1px;
bottom: -1px;
z-index: variables.$z-index-metadata-panel;
z-index: variables.$zindex-metadata-panel;
display: flex;
flex-direction: column;
width: 100%;
Expand Down Expand Up @@ -254,7 +254,7 @@ $list-inline-spacing: 0.2em;
flex-direction: row;
justify-content: center;
padding: 0;
z-index: 1;
z-index: variables.$zindex-metadata-link;

&:hover {
background-color: var(--color-button-plot-hovered);
Expand Down
14 changes: 7 additions & 7 deletions src/components/node-list/styles/_group.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '../../../styles/variables' as colors;
@use '../../../styles/variables' as var;
@use './variables';

%nolist {
Expand Down Expand Up @@ -28,7 +28,7 @@ $placeholder-fade: 120px;

.pipeline-nodelist__placeholder-upper,
.pipeline-nodelist__placeholder-lower {
z-index: 2;
z-index: var.$zindex-nodelist-placeholder;
pointer-events: none;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ $placeholder-fade: 120px;
.pipeline-nodelist__heading {
position: sticky;
top: 0;
z-index: 1;
z-index: var.$zindex-nodelist-heading;
margin: 0;

// Avoid pixel gap above when scrolling.
Expand All @@ -94,7 +94,7 @@ $placeholder-fade: 120px;
&::after {
position: absolute;
bottom: -19px;
z-index: -1;
z-index: var.$zindex-group-background-fade;
width: 100%;
height: 20px;
background: linear-gradient(
Expand All @@ -114,7 +114,7 @@ $placeholder-fade: 120px;
&::after {
position: absolute;
bottom: -19px;
z-index: -1;
z-index: var.$zindex-group-background-fade;
width: 100%;
height: 20px;
background: linear-gradient(
Expand Down Expand Up @@ -148,7 +148,7 @@ $placeholder-fade: 120px;
outline: none;

[data-whatintent='keyboard'] & {
box-shadow: 0 0 0 3px colors.$blue-300 inset;
box-shadow: 0 0 0 3px var.$blue-300 inset;
}
}

Expand All @@ -167,7 +167,7 @@ $placeholder-fade: 120px;
}

&--disabled {
color: colors.$black-400;
color: var.$black-400;
transform: rotate(90deg);
}
}
10 changes: 5 additions & 5 deletions src/components/node-list/styles/_panels.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@use '../../../styles/variables' as colors;
@use '../../../styles/variables' as var;
@use './variables';

.pipeline-nodelist__filter-panel {
z-index: 1;
z-index: var.$zindex-filter-panel;
background: var(--color-nodelist-filter-panel);
border-top: 1px solid var(--color-border-line);

Expand Down Expand Up @@ -64,8 +64,8 @@

// Handle has keyboard focus, show outline.
&:focus {
z-index: 1;
outline: 3px solid colors.$blue-300;
z-index: var.$zindex-split-handle-focus;
outline: 3px solid var.$blue-300;
}

// Handle is hovered, highlight border.
Expand All @@ -80,7 +80,7 @@

// Handle is active resizing, highlight border.
.pipeline-nodelist__split--resizing & {
border-top: 1px solid colors.$blue-300;
border-top: 1px solid var.$blue-300;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/node-list/styles/_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use './variables';

.MuiTreeItem-iconContainer svg {
z-index: var.$z-index-MuiTreeItem-icon;
z-index: var.$zindex-MuiTreeItem-icon;
}

.pipeline-nodelist__row {
Expand Down
2 changes: 1 addition & 1 deletion src/components/preview-table/preview-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
background: var(--color-bg);
position: sticky;
top: 0;
z-index: 1;
z-index: variables.$zindex-preview-table-header;
}

.preview-table__row:hover,
Expand Down
4 changes: 2 additions & 2 deletions src/components/search-list/search-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
right: 2px;
top: 18px;
width: 20px;
z-index: 1;
z-index: variables.$zindex-search-close-icon;
}

.search-bar .icon__graphics {
Expand Down Expand Up @@ -42,7 +42,7 @@

.search-input--focused {
position: relative;
z-index: 1;
z-index: variables.$zindex-search-input-focused;
outline-color: variables.$blue-300;
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/sidebar/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
}

// Ensures sidebar tooltips are above code panel
z-index: 1;
z-index: variables.$zindex-sidebar;
display: flex;
width: 100%;
transform: translateX(calc(-100% + #{variables.$sidebar-width-closed}));
transition: transform ease 0.4s;

@media (min-width: variables.$metadata-sidebar-code-breakpoint) {
z-index: 3;
z-index: variables.$zindex-sidebar-expanded;
}

@media (min-width: variables.$sidebar-width-breakpoint) {
Expand Down Expand Up @@ -55,7 +55,7 @@
position: relative;
transition: visibility 0.3s;
visibility: hidden;
z-index: 2;
z-index: variables.$zindex-ui;

.pipeline-sidebar--visible & {
visibility: visible;
Expand All @@ -75,7 +75,7 @@
height: 100%;
position: relative;
width: variables.$sidebar-width-closed;
z-index: 2;
z-index: variables.$zindex-toolbar;
}

.compare-switch-wrapper__text {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/banner/banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
justify-content: space-between;
padding: 16px;
width: 100%;
z-index: variables.$z-index-banner;
z-index: variables.$zindex-banner;
font-family: inherit;
box-shadow: var(--banner-box-shadow);
background-color: var(--banner--background);
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/dropdown/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $menu-item-padding: 12px;
position: relative;
user-select: none;
width: 100%;
z-index: 8;
z-index: variables.$zindex-dropdown-label;

&:disabled {
cursor: not-allowed;
Expand Down Expand Up @@ -107,7 +107,7 @@ $menu-item-padding: 12px;
}

.dropdown__options {
z-index: 2; // fix closing transition animation bug
z-index: variables.$zindex-dropdown-options;
background: var(--dropdown-options-bg);
border-top: none;
box-shadow: 0 0 2px variables.$black-800;
Expand Down Expand Up @@ -144,5 +144,5 @@ $menu-item-padding: 12px;
justify-content: space-around;
padding: 24px 0;
position: sticky;
z-index: 1;
z-index: variables.$zindex-dropdown-btn-wrapper;
}
2 changes: 1 addition & 1 deletion src/components/ui/icon-button/icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $triangle-size: 7px;
white-space: nowrap;

// to ensure the tooltip will show on the top of the bookmark dropdown
z-index: 1;
z-index: variables.$zindex-toolbar-label;

@media (max-width: variables.$sidebar-width-breakpoint) {
.pipeline-sidebar--visible & {
Expand Down
Loading
Loading