Skip to content

Commit

Permalink
feat(chat-list): scrollbar style
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Dec 29, 2022
1 parent f711e12 commit a02074d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions ui/demo-pwa/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@import url('tokens/state.css');
@import url('tokens/elevation.css');
@import url('tokens/spacing.css');
@import url('tokens/scrollbar.css');
@import url('tokens/z-index.css');

@import url('safe-area.css');
Expand Down
7 changes: 7 additions & 0 deletions ui/demo-pwa/style/tokens/scrollbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:root {
--md-scrollbar-size: var(--md-sys-spacing-track-1);
--md-scrollbar-background: transparent;
--md-scrollbar-color: var(--md-sys-color-secondary);
--md-scrollbar-color-hover: var(--md-sys-color-secondary);
--md-scrollbar-radius: 0;
}
23 changes: 21 additions & 2 deletions ui/ui-kit/src/chat/chat-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,27 @@ export class AlwatrChatList extends AlwatrDummyElement {
flex-direction: column;
padding: var(--md-sys-spacing-track-3) var(--md-sys-spacing-track-2) var(--md-sys-spacing-track-2);
gap: var(--md-sys-spacing-track-2);
color: var(--md-sys-color-on-surface-variant);
background-color: var(--md-sys-color-surface-variant);
flex-grow: 1;
overflow-y: auto;
}
:host(::-webkit-scrollbar) {
width: var(--theme-scrollbar-size);
height: var(--theme-scrollbar-size);
}
:host(::-webkit-scrollbar-corner),
:host(::-webkit-scrollbar-track) {
background-color: red;
}
:host(::-webkit-scrollbar-thumb) {
background-color: var(--theme-scrollbar-color);
border-radius: var(--theme-scrollbar-radius);
}
:host(::-webkit-scrollbar-thumb:hover) {
background-color: var(--theme-scrollbar-color-hover);
}
`;

Expand Down

0 comments on commit a02074d

Please sign in to comment.