From 6fae9437c4c361ed6e5658e44b04ca33f721ae9a Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Mon, 20 May 2024 15:13:40 -0500 Subject: [PATCH] consolidate css for scroll lists in `style/list-item.scss` --- .../components/History/HistoryScrollList.vue | 112 +----------------- .../Invocation/InvocationScrollList.vue | 104 ---------------- client/src/style/scss/list-item.scss | 105 ++++++++++++++++ 3 files changed, 107 insertions(+), 214 deletions(-) diff --git a/client/src/components/History/HistoryScrollList.vue b/client/src/components/History/HistoryScrollList.vue index e194f596a0af..dad3c94eb05a 100644 --- a/client/src/components/History/HistoryScrollList.vue +++ b/client/src/components/History/HistoryScrollList.vue @@ -235,7 +235,7 @@ async function loadMore(noScroll = false) {
-@import "theme/blue.scss"; - -.flex-column-overflow { - display: flex; - flex-direction: column; - overflow: auto; -} - -.history-list-container { - position: relative; - - &.in-panel { - flex-grow: 1; - } - - &:not(&.in-panel) { - @extend .flex-column-overflow; - } - - &:before, - &:after { - position: absolute; - content: ""; - pointer-events: none; - z-index: 10; - height: 30px; - width: 100%; - opacity: 0; - - background-repeat: no-repeat; - transition: opacity 0.4s; - } - - &:before { - top: 0; - background-image: linear-gradient(to bottom, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); - } - - &:not(.scrolled-top) { - &:before { - opacity: 1; - } - } - - &:after { - bottom: 0; - background-image: linear-gradient(to top, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); - } - - &:not(.scrolled-bottom) { - &:after { - opacity: 1; - } - } -} - -.history-scroll-list { - overflow-x: hidden; - overflow-y: scroll; - scroll-behavior: smooth; - - &.in-panel { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - } - - .list-group { - .list-group-item { - display: flex; - border-radius: 0; - - &.current { - border-left: 0.25rem solid $brand-primary; - } - - &.panel-item { - justify-content: space-between; - align-items: center; - &:not(&.active) { - background: $panel-bg-color; - } - } - - &:not(&.panel-item) { - &:first-child { - border-top-left-radius: inherit; - border-top-right-radius: inherit; - } - - &:last-child { - border-bottom-left-radius: inherit; - border-bottom-right-radius: inherit; - } - } - } - } - .list-end { - width: 100%; - text-align: center; - color: $text-light; - } -} - diff --git a/client/src/components/Workflow/Invocation/InvocationScrollList.vue b/client/src/components/Workflow/Invocation/InvocationScrollList.vue index 0414674aab1b..0e78c686650f 100644 --- a/client/src/components/Workflow/Invocation/InvocationScrollList.vue +++ b/client/src/components/Workflow/Invocation/InvocationScrollList.vue @@ -262,108 +262,4 @@ function workflowName(workflowId: string) { -webkit-box-orient: vertical; overflow: hidden; } - -.flex-column-overflow { - display: flex; - flex-direction: column; - overflow: auto; -} - -.scroll-list-container { - position: relative; - - &.in-panel { - flex-grow: 1; - } - - &:not(&.in-panel) { - @extend .flex-column-overflow; - } - - &:before, - &:after { - position: absolute; - content: ""; - pointer-events: none; - z-index: 10; - height: 30px; - width: 100%; - opacity: 0; - - background-repeat: no-repeat; - transition: opacity 0.4s; - } - - &:before { - top: 0; - background-image: linear-gradient(to bottom, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); - } - - &:not(.scrolled-top) { - &:before { - opacity: 1; - } - } - - &:after { - bottom: 0; - background-image: linear-gradient(to top, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); - } - - &:not(.scrolled-bottom) { - &:after { - opacity: 1; - } - } -} - -.scroll-list { - overflow-x: hidden; - overflow-y: scroll; - scroll-behavior: smooth; - - &.in-panel { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - } - - .list-group { - .list-group-item { - display: flex; - border-radius: 0; - - &.current { - border-left: 0.25rem solid $brand-primary; - } - - &.panel-item { - justify-content: space-between; - align-items: center; - &:not(&.active) { - background: $panel-bg-color; - } - } - - &:not(&.panel-item) { - &:first-child { - border-top-left-radius: inherit; - border-top-right-radius: inherit; - } - - &:last-child { - border-bottom-left-radius: inherit; - border-bottom-right-radius: inherit; - } - } - } - } - .list-end { - width: 100%; - text-align: center; - color: $text-light; - } -} diff --git a/client/src/style/scss/list-item.scss b/client/src/style/scss/list-item.scss index 2e9611b761d5..90e9a0b98d43 100644 --- a/client/src/style/scss/list-item.scss +++ b/client/src/style/scss/list-item.scss @@ -239,3 +239,108 @@ $vertical-gap: 8px; } } } + +// ---------------------------------------------------------------------------- a scroll list (like `HistoryScrollList`) +.flex-column-overflow { + display: flex; + flex-direction: column; + overflow: auto; +} + +.scroll-list-container { + position: relative; + + &.in-panel { + flex-grow: 1; + } + + &:not(&.in-panel) { + @extend .flex-column-overflow; + } + + &:before, + &:after { + position: absolute; + content: ""; + pointer-events: none; + z-index: 10; + height: 30px; + width: 100%; + opacity: 0; + + background-repeat: no-repeat; + transition: opacity 0.4s; + } + + &:before { + top: 0; + background-image: linear-gradient(to bottom, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); + } + + &:not(.scrolled-top) { + &:before { + opacity: 1; + } + } + + &:after { + bottom: 0; + background-image: linear-gradient(to top, rgba(3, 0, 48, 0.1), rgba(3, 0, 48, 0.02), rgba(3, 0, 48, 0)); + } + + &:not(.scrolled-bottom) { + &:after { + opacity: 1; + } + } +} + +.scroll-list { + overflow-x: hidden; + overflow-y: scroll; + scroll-behavior: smooth; + + &.in-panel { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + } + + .list-group { + .list-group-item { + display: flex; + border-radius: 0; + + &.current { + border-left: 0.25rem solid $brand-primary; + } + + &.panel-item { + justify-content: space-between; + align-items: center; + &:not(&.active) { + background: $panel-bg-color; + } + } + + &:not(&.panel-item) { + &:first-child { + border-top-left-radius: inherit; + border-top-right-radius: inherit; + } + + &:last-child { + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; + } + } + } + } + .list-end { + width: 100%; + text-align: center; + color: $text-light; + } +}