Skip to content

Commit

Permalink
consolidate css for scroll lists in style/list-item.scss
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed May 20, 2024
1 parent 55c011a commit 6fae943
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 214 deletions.
112 changes: 2 additions & 110 deletions client/src/components/History/HistoryScrollList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async function loadMore(noScroll = false) {
</div>

<div
class="history-list-container"
class="scroll-list-container"
:class="{
'in-panel': isMultiviewPanel,
'scrolled-top': scrolledTop,
Expand All @@ -245,7 +245,7 @@ async function loadMore(noScroll = false) {
v-show="!showAdvanced"
ref="scrollableDiv"
:class="{
'history-scroll-list': !hasNoResults,
'scroll-list': !hasNoResults,
'in-panel': isMultiviewPanel,
'in-modal': props.inModal,
toolMenuContainer: isMultiviewPanel,
Expand Down Expand Up @@ -381,111 +381,3 @@ async function loadMore(noScroll = false) {
</div>
</div>
</template>

<style lang="scss" scoped>
@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;
}
}
</style>
104 changes: 0 additions & 104 deletions client/src/components/Workflow/Invocation/InvocationScrollList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
</style>
105 changes: 105 additions & 0 deletions client/src/style/scss/list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 6fae943

Please sign in to comment.