Skip to content

Commit

Permalink
style: update scrollbar style and add scrollbar CSS variables
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Aug 21, 2022
1 parent 62fc595 commit 76f13ea
Showing 4 changed files with 22 additions and 13 deletions.
13 changes: 0 additions & 13 deletions assets/main/scss/_code.scss
Original file line number Diff line number Diff line change
@@ -48,19 +48,6 @@ pre {
padding: 1rem;
position: relative;

&::-webkit-scrollbar {
width: 10px;
height: 10px;
}

&::-webkit-scrollbar-thumb {
background: var(--#{$prefix}secondary);
}

&::-webkit-scrollbar-corner {
background: var(--#{$prefix}secondary);
}

code {
padding: 0;
background: inherit !important;
5 changes: 5 additions & 0 deletions assets/main/scss/_root.scss
Original file line number Diff line number Diff line change
@@ -14,6 +14,11 @@
--#{$prefix}surface-color-secondary: #{$surface-color-secondary};
--#{$prefix}surface-color-disabled: #{$surface-color-disabled};
--#{$prefix}shadow-rgb: 0, 0, 0;
--#{$prefix}scrollbar-width: 10px;
--#{$prefix}scrollbar-height: 10px;
--#{$prefix}scrollbar-track-bg: var(--#{$prefix}secondary-bg);
--#{$prefix}scrollbar-thumb-bg: var(--#{$prefix}secondary);
--#{$prefix}scrollbar-corner-bg: var(--#{$prefix}secondary);
}

[data-bs-theme='dark'] {
16 changes: 16 additions & 0 deletions assets/main/scss/_scrollbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
::-webkit-scrollbar {
width: var(--#{$prefix}scrollbar-width);
height: var(--#{$prefix}scrollbar-height);
}

::-webkit-scrollbar-track {
background: var(--#{$prefix}scrollbar-track-bg);
}

::-webkit-scrollbar-thumb {
background: var(--#{$prefix}scrollbar-thumb-bg);
}

::-webkit-scrollbar-corner {
background: var(--#{$prefix}scrollbar-corner-bg);
}
1 change: 1 addition & 0 deletions assets/main/scss/index.scss
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
@import 'snackbar';
@import 'docs';
@import 'carousel';
@import 'scrollbar';
@import 'custom';

/*!purgecss end ignore*/

0 comments on commit 76f13ea

Please sign in to comment.