Skip to content

Commit

Permalink
Make body scrollbar option more extendable
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperStrike committed Apr 15, 2021
1 parent 8d77f69 commit 215e456
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,12 @@ mobile_layout_economy: false
# Android Chrome header panel color ($brand-bg / $headband-bg => $black-deep).
android_chrome_color: "#222"

# Available values: default | overlay | stable
body_scrollbar_style: default
# Override browsers' default behavior.
body_scrollbar:
# Place the scrollbar over the content.
overlay: false
# Present the scrollbar even if the content is not overflowing.
stable: false

codeblock:
# Code Highlight theme
Expand Down
6 changes: 4 additions & 2 deletions source/css/_common/scaffolding/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ body {
position: relative;
transition: padding $transition-ease;

if (hexo-config('body_scrollbar_style') == 'overlay') {
if (hexo-config('body_scrollbar.overlay')) {
overflow-x: hidden;
@supports (overflow-x: clip) {
overflow-x: clip;
}
width: 100vw;
} else if (hexo-config('body_scrollbar_style') == 'stable') {
}

if (hexo-config('body_scrollbar.stable')) {
overflow-y: scroll;
}
}
Expand Down

0 comments on commit 215e456

Please sign in to comment.