mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Better scrollbars on non-Mac systems
This commit is contained in:
parent
6e1c617d62
commit
1b81312893
7 changed files with 67 additions and 15 deletions
|
@ -71,6 +71,14 @@
|
||||||
|
|
||||||
// Create the element to be the ghost drag image.
|
// Create the element to be the ghost drag image.
|
||||||
$('<div id="dragGhost"></div>').appendTo('body');
|
$('<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: {
|
methods: {
|
||||||
|
|
|
@ -93,8 +93,9 @@
|
||||||
display: none;
|
display: none;
|
||||||
color: $color2ndText;
|
color: $color2ndText;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||||
|
|
||||||
&:hover, html.touchevents & {
|
html.touchevents & {
|
||||||
// Enable scroll with momentum on touch devices
|
// Enable scroll with momentum on touch devices
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: hidden;
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||||
|
|
||||||
&:hover, html.touchevents & {
|
html.touchevents & {
|
||||||
// Enable scroll with momentum on touch devices
|
// Enable scroll with momentum on touch devices
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
|
@ -153,7 +153,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media only screen
|
@media only screen
|
||||||
and (max-device-width : 768px) {
|
and (max-device-width : 768px) {
|
||||||
h1.heading {
|
h1.heading {
|
||||||
|
|
|
@ -161,9 +161,9 @@
|
||||||
padding: 22px 0 0;
|
padding: 22px 0 0;
|
||||||
max-height: calc(100vh - #{$headerHeight + $footerHeight});
|
max-height: calc(100vh - #{$headerHeight + $footerHeight});
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-y: hidden;
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||||
|
|
||||||
&:hover, html.touchevents & {
|
html.touchevents & {
|
||||||
// Enable scroll with momentum on touch devices
|
// Enable scroll with momentum on touch devices
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
@import "partials/_vars.scss";
|
@import "partials/_vars.scss";
|
||||||
@import "partials/_mixins.scss";
|
@import "partials/_mixins.scss";
|
||||||
|
@import "partials/_hacks.scss";
|
||||||
|
|
||||||
// Here we set some default variables to tweak plyr to our theme.
|
// Here we set some default variables to tweak plyr to our theme.
|
||||||
$plyr-blue: $colorHighlight;
|
$plyr-blue: $colorHighlight;
|
||||||
|
|
51
resources/assets/sass/partials/_hacks.scss
Normal file
51
resources/assets/sass/partials/_hacks.scss
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,8 +8,7 @@ body, html {
|
||||||
}
|
}
|
||||||
|
|
||||||
input, select, button, textarea, .btn {
|
input, select, button, textarea, .btn {
|
||||||
-webkit-appearance: none;
|
appearance: none;
|
||||||
-moz-appearance: none;
|
|
||||||
border: 0;
|
border: 0;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
font-family: $fontFamily;
|
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 {
|
.form-row {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
Loading…
Reference in a new issue