Skip to content

Commit

Permalink
Custom the scrollbar on Webkit browsers
Browse files Browse the repository at this point in the history
the default scrollbar on Windows looks like shit
  • Loading branch information
cotes2020 committed Sep 14, 2021
1 parent 13da116 commit c0753c9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ body {
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;
}

/* --- Scrollbar --- */

$scrollbar-size: 7px;

::-webkit-scrollbar {
width: $scrollbar-size;
height: $scrollbar-size;
}

::-webkit-scrollbar-track {
@at-root body#{&} {
-webkit-box-shadow: inset 0 0 6px var(--scrollbar-track-bg);
}
}

::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb-bg);
border-radius: calc(#{$scrollbar-size} / 2);
}

/* --- Typography --- */

h1 {
Expand Down
2 changes: 2 additions & 0 deletions _sass/colors/dark-typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
--input-focus-border-color: rgb(112, 114, 115);
--mask-bg: rgb(68, 69, 70);
--footer-bg-color: var(--main-wrapper-bg);
--scrollbar-track-bg: rgba(0,0,0,0.3);
--scrollbar-thumb-bg: rgb(173 171 171 / 50%);

/* common color */
--text-color: rgb(175, 176, 177);
Expand Down
2 changes: 2 additions & 0 deletions _sass/colors/light-typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
--btn-box-shadow: #eaeaea;
--checkbox-color: #c5c5c5;
--checkbox-checked-color: #07a8f7;
--scrollbar-track-bg: rgba(0,0,0,0.3);
--scrollbar-thumb-bg: rgba(0,0,0,0.3);

/* Sidebar */
--sidebar-bg: radial-gradient(circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%);
Expand Down

0 comments on commit c0753c9

Please sign in to comment.