Skip to content

Commit

Permalink
feat: new config param customizeScrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Oct 9, 2021
1 parent 4fcacbf commit 2c06353
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
20 changes: 0 additions & 20 deletions assets/scss/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,3 @@ a {
::selection {
background-color: alpha(var(--color-primary), 0.3);
}

::-webkit-scrollbar {
width: 0.5rem;
height: 0.5rem;
}
::-webkit-scrollbar-track {
background-color: var(--color-bg);
}
::-webkit-scrollbar-thumb {
background-color: var(--color-contrast-low);
&:hover {
background-color: alpha(var(--color-primary), 0.5);
}
&:active {
background-color: alpha(var(--color-primary), 0.75);
}
}
::-webkit-scrollbar-corner {
background-color: var(--color-bg);
}
19 changes: 19 additions & 0 deletions assets/scss/base/_scrollbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
::-webkit-scrollbar {
width: 0.5rem;
height: 0.5rem;
}
::-webkit-scrollbar-track {
background-color: var(--color-bg);
}
::-webkit-scrollbar-thumb {
background-color: var(--color-contrast-low);
&:hover {
background-color: alpha(var(--color-primary), 0.5);
}
&:active {
background-color: alpha(var(--color-primary), 0.75);
}
}
::-webkit-scrollbar-corner {
background-color: var(--color-bg);
}
4 changes: 4 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ $baseRelURL: "{{ strings.TrimSuffix (.Site.BaseURL | relURL) "/" }}";

@import "base/base";

{{ if .Site.Params.customizeScrollbar }}
@import "base/scrollbar";
{{ end }}


// Typography

Expand Down
5 changes: 5 additions & 0 deletions config-examples/en/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,11 @@ uglyURLs = false
# in the Markdown file.


######################################
# Scrollbar
customizeScrollbar = true


######################################
# Typography

Expand Down
5 changes: 5 additions & 0 deletions config-examples/zh-cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,11 @@ uglyURLs = false
# 分隔开来,那么这项设置将会非常有用。


######################################
# 滚动条
customizeScrollbar = true


######################################
# 字体排版

Expand Down
5 changes: 5 additions & 0 deletions config-examples/zh-tw/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,11 @@ uglyURLs = false
# 分隔開來,那麼這項設定將會非常有用。


######################################
# 滾動條
customizeScrollbar = true


######################################
# 字型排版

Expand Down

1 comment on commit 2c06353

@reuixiy
Copy link
Owner Author

@reuixiy reuixiy commented on 2c06353 Oct 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want a nice Apple style scrollbar for your Google Chrome, just open chrome://flags/#overlay-scrollbars, and enable it!

Please sign in to comment.