Better scrollbars on non-Mac systems

This commit is contained in:
An Phan 2016-03-13 11:28:43 +08:00
parent 6e1c617d62
commit 1b81312893
7 changed files with 67 additions and 15 deletions

View file

@ -71,6 +71,14 @@
// Create the element to be the ghost drag image.
$('<div id="dragGhost"></div>').appendTo('body');
// Add an ugly mac/non-mac class for OS-targeting styles.
// I'm crying inside.
if (navigator.userAgent.indexOf('Mac') !== -1) {
$("html").addClass("mac");
} else {
$("html").addClass("non-mac");
}
},
methods: {

View file

@ -93,8 +93,9 @@
display: none;
color: $color2ndText;
overflow: auto;
-ms-overflow-style: -ms-autohiding-scrollbar;
&:hover, html.touchevents & {
html.touchevents & {
// Enable scroll with momentum on touch devices
overflow-y: scroll;
-webkit-overflow-scrolling: touch;

View file

@ -85,9 +85,9 @@
padding: 24px;
overflow: auto;
flex: 1;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
&:hover, html.touchevents & {
html.touchevents & {
// Enable scroll with momentum on touch devices
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
@ -153,7 +153,6 @@
}
@media only screen
and (max-device-width : 768px) {
h1.heading {

View file

@ -161,9 +161,9 @@
padding: 22px 0 0;
max-height: calc(100vh - #{$headerHeight + $footerHeight});
overflow: auto;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
&:hover, html.touchevents & {
html.touchevents & {
// Enable scroll with momentum on touch devices
overflow-y: scroll;
-webkit-overflow-scrolling: touch;

View file

@ -2,6 +2,7 @@
@import "partials/_vars.scss";
@import "partials/_mixins.scss";
@import "partials/_hacks.scss";
// Here we set some default variables to tweak plyr to our theme.
$plyr-blue: $colorHighlight;

View file

@ -0,0 +1,51 @@
/**
* ALL YOUR DIRTY UGLY HACKS ARE BELONG TO US.
*/
/**
* Make elements draggable in old WebKit
*/
[draggable] {
user-select: none;
-khtml-user-drag: element;
-webkit-user-drag: element;
}
/**
* Make webkit scrollbars a bit more good looking on non-mac systems.
*/
html.non-mac {
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-button {
width: 0px;
height: 0px;
}
::-webkit-scrollbar-thumb {
background: $colorMainBgr;
border: 1px solid rgba(255, 255, 255, .2);
border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover {
background: #303030;
}
::-webkit-scrollbar-thumb:active {
background: $colorMainBgr;
}
::-webkit-scrollbar-track {
background: $colorMainBgr;
border: 0px none #ffffff;
border-radius: 50px;
}
::-webkit-scrollbar-track:hover {
background: $colorMainBgr;
}
::-webkit-scrollbar-track:active {
background: #333333;
}
::-webkit-scrollbar-corner {
background: transparent;
}
}

View file

@ -8,8 +8,7 @@ body, html {
}
input, select, button, textarea, .btn {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: 0;
outline: 0;
font-family: $fontFamily;
@ -226,13 +225,6 @@ button, input[type="submit"], input[type="reset"], input[type="button"], .btn {
}
}
[draggable] {
user-select: none;
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;
}
.form-row {
margin-top: 16px;
position: relative;