未验证 提交 3f61c730 编写于 作者: D Dylan DPC 提交者: GitHub

Rollup merge of #70656 - GuillaumeGomez:scrollbar-display, r=kinnison

Improve scrollbar display in rustdoc

The scrollbar of the left sidebar in rustdoc looks very bad on firefox (on dark theme). This PR improves it:

<div style="display:inline-block;">
<div style="width:50%;display:inline-block;float:left;">
<image src="https://user-images.githubusercontent.com/3050060/78148412-202b0380-7435-11ea-8ff3-79f02ea8f9ed.png">
</div>
<div style="width:50%;display:inline-block;float:left;">
<image src="https://user-images.githubusercontent.com/3050060/78148437-28833e80-7435-11ea-946b-a6fc9320b705.png">
</div>
</div>

With light theme:

![old-firefox-light](https://user-images.githubusercontent.com/3050060/78148718-7bf58c80-7435-11ea-93d3-2a2cafd5c6ae.png)
![firefox-light](https://user-images.githubusercontent.com/3050060/78148736-7f891380-7435-11ea-8b10-a8898f73b4c9.png)

And on chrome:

![chrome-light](https://user-images.githubusercontent.com/3050060/78148903-ac3d2b00-7435-11ea-9a10-6c0376a675c3.png)
![chrome-dark](https://user-images.githubusercontent.com/3050060/78148907-ae9f8500-7435-11ea-9b89-0397b977753c.png)

Small extra question: should I extend it to all scrollbars? I think it'd be better but just in case...

r? @kinnison
......@@ -184,6 +184,25 @@ nav.sub {
overflow: auto;
}
/* Improve the scrollbar display on firefox */
* {
scrollbar-width: initial;
}
.sidebar {
scrollbar-width: thin;
}
/* Improve the scrollbar display on webkit-based browsers */
::-webkit-scrollbar {
width: 12px;
}
.sidebar::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0;
}
.sidebar .block > ul > li {
margin-right: -10px;
}
......
......@@ -32,6 +32,28 @@ pre {
background-color: #505050;
}
/* Improve the scrollbar display on firefox */
* {
scrollbar-color: rgb(64, 65, 67) #717171;
}
.sidebar {
scrollbar-color: rgba(32,34,37,.6) transparent;
}
/* Improve the scrollbar display on webkit-based browsers */
::-webkit-scrollbar-track {
background-color: #717171;
}
::-webkit-scrollbar-thumb {
background-color: rgba(32, 34, 37, .6);
}
.sidebar::-webkit-scrollbar-track {
background-color: #717171;
}
.sidebar::-webkit-scrollbar-thumb {
background-color: rgba(32, 34, 37, .6);
}
.sidebar .current {
background-color: #333;
}
......
......@@ -34,6 +34,29 @@ pre {
background-color: #F1F1F1;
}
/* Improve the scrollbar display on firefox */
* {
scrollbar-color: rgba(36, 37, 39, 0.6) #e6e6e6;
}
.sidebar {
scrollbar-color: rgba(36, 37, 39, 0.6) #d9d9d9;
}
/* Improve the scrollbar display on webkit-based browsers */
::-webkit-scrollbar-track {
background-color: #ecebeb;
}
::-webkit-scrollbar-thumb {
background-color: rgba(36, 37, 39, 0.6);
}
.sidebar::-webkit-scrollbar-track {
background-color: #dcdcdc;
}
.sidebar::-webkit-scrollbar-thumb {
background-color: rgba(36, 37, 39, 0.6);
}
.sidebar .current {
background-color: #fff;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册