Skip to content

Commit

Permalink
add scrollbar style
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelbt committed Nov 24, 2024
1 parent 2eb4d06 commit c0438a2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
4 changes: 4 additions & 0 deletions libs/components/src/lib/file-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ The `helper-text` slot allows you to use rich content as the file picker's helpe
Each added file in the preview list has a default background-color of `vvd-color-canvas` (`#fff` in light theme, `#000` in dark).
If needed, the background of the item can be changed using the `--file-picker-list-item-background-color` CSS variable.

### file-picker-list-block-size

Use `--file-picker-list-block-size` the set the max-block-size of list of the added files, other than `408px`.

## Properties

<div class="table-wrapper">
Expand Down
24 changes: 16 additions & 8 deletions libs/components/src/lib/file-picker/file-picker.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@use 'partials/variables' as variables;
@use '../../../../../dist/libs/tokens/scss/tokens.constants' as constants;
@use '../../../../../dist/libs/tokens/scss/size.variables' as size;
@use '../../../../shared/src/lib/sass/mixins/border-radius' as
border-radius-variables;
@use '../../../../shared/src/lib/sass/mixins/focus' as focus;
@use '../../../../shared/src/lib/sass/mixins/focus' as focus-variables;
@use '../../../../shared/src/lib/sass/mixins/scrollbar' as scrollbar;

$low-ink-color: --_low-ink-color;
$file-picker-list-item-background-color: --file-picker-list-item-background-color;

:host {
display: block;
Expand Down Expand Up @@ -48,7 +49,9 @@ $file-picker-list-item-background-color: --file-picker-list-item-background-colo

@include focus.focus;
}
&:hover {
&:hover,
&:active,
&:focus-visible {
border-style: solid;
background-color: var(#{constants.$vvd-color-cta-100});
}
Expand All @@ -65,7 +68,7 @@ $file-picker-list-item-background-color: --file-picker-list-item-background-colo
border: 1px solid var(#{constants.$vvd-color-neutral-300});
border-radius: #{border-radius-variables.$border-radius-normal};
background-color: var(
#{$file-picker-list-item-background-color},
#{variables.$file-picker-list-item-background-color},
var(#{constants.$vvd-color-canvas})
);
grid-template-columns: 1fr auto;
Expand Down Expand Up @@ -127,11 +130,16 @@ $file-picker-list-item-background-color: --file-picker-list-item-background-colo
}

.preview-list {
display: flex;
flex-direction: column;
gap: 12px;
margin-block-start: 12px;
overflow-y: auto;
@include scrollbar.scrollbar;

& {
display: flex;
flex-direction: column;
gap: 12px;
margin-block-start: 12px;
max-block-size: var(variables.$file-picker-list-block-size, 408px);
overflow-y: auto;
}

&:empty {
display: none;
Expand Down
2 changes: 2 additions & 0 deletions libs/components/src/lib/file-picker/partials/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$file-picker-list-item-background-color: --file-picker-list-item-background-color;
$file-picker-list-block-size: --file-picker-list-block-size;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions libs/components/src/lib/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ slot[name='action-items'] {

.base.scroll & {
overflow-y: auto;

@include scrollbar.scrollbar;
}

Expand Down

0 comments on commit c0438a2

Please sign in to comment.