From 149c66917605a240eeb526f47aadf1ec83610646 Mon Sep 17 00:00:00 2001 From: Listen 1 Date: Thu, 15 Feb 2018 00:16:20 +0800 Subject: [PATCH] change scrollbar to nice ios style (by @zhuzhuyule) --- README.md | 3 ++- css/cover.css | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 29b5b65..23d2f57 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,10 @@ Firefox打包安装 `2018-02-14` -* 修复主页在加载更多数据时出现双重滚动条的bug(感谢@zhuzhuyule的提交) +* 修复主页在加载更多数据时出现双重滚动条的bug,并修改了滚动条样式(感谢@zhuzhuyule的提交) * 修复打开歌单时,网易云音乐个人歌单地址无法解析的bug(感谢@zhuzhuyule的提交) + `2017-12-26` * 增加同步歌单到Github Gist功能。(特别感谢@ConstLhq提供创意和部分代码实现) diff --git a/css/cover.css b/css/cover.css index 7af4d6f..924de55 100644 --- a/css/cover.css +++ b/css/cover.css @@ -2,7 +2,7 @@ * Globals */ -/* Links */ + /* Links */ a, a:focus, a:hover { @@ -161,4 +161,45 @@ body { .cover-container { width: 880px; } -} \ No newline at end of file +} + +/* + * Scroll bar + * + */ +:root{ + --scrollWidth: 10px; +} + +::-webkit-scrollbar { + width: var(--scrollWidth) !important; + height: var(--scrollWidth) !important; +} +::-webkit-scrollbar-button { + width: 0 !important; + height: 0 !important; +} +::-webkit-scrollbar-button:start:increment, +::-webkit-scrollbar-button:end:decrement { + display: none !important; +} +::-webkit-scrollbar-corner { + display: block !important; +} + +::-webkit-scrollbar-track, +::-webkit-scrollbar-thumb { + border-radius: 8px !important; + border-right: 1px solid transparent !important; + border-left: 1px solid transparent !important; +} + +::-webkit-scrollbar-thumb { + background-color: rgba(255,255,255,0.2); +} +::-webkit-scrollbar-thumb:hover { + background-color: rgba(255,255,255,0.3); +} +::-webkit-scrollbar-track:hover { + background-color: rgba(255,255,255,0.08) !important; +}