1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Setting global webkit-scrollbar styles

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-11-23 13:19:14 +03:00
parent 8c73861962
commit 80c0aa0d6f
2 changed files with 27 additions and 55 deletions

View File

@ -1,15 +1,6 @@
@import "~flex.box";
@import "fonts";
*, *:before, *:after {
box-sizing: border-box;
padding: 0;
margin: 0;
border: 0;
outline: none;
-webkit-font-smoothing: antialiased;
}
:root {
--unit: 8px;
--padding: var(--unit);
@ -27,6 +18,33 @@
--drag-region-height: 22px
}
*, *:before, *:after {
box-sizing: border-box;
padding: 0;
margin: 0;
border: 0;
outline: none;
-webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar {
width: 16px;
height: 15px; // Align sizes visually
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--scrollBarColor);
background-clip: padding-box;
border: 4px solid transparent;
border-right-width: 5px;
border-radius: 16px;
}
::-webkit-scrollbar-corner {
background-color: transparent;
}
::selection {
background: $primary;
color: white;

View File

@ -6,52 +6,6 @@
@import "table/table.mixins";
@import "+network/network-mixins";
// todo: re-use in other places with theming
@mixin custom-scrollbar-themed($invert: false) {
@if ($invert) {
@include custom-scrollbar(dark);
.theme-light & {
@include custom-scrollbar(light);
}
} @else {
// fits better with dark background
@include custom-scrollbar(light);
.theme-light & {
@include custom-scrollbar(dark);
}
}
}
@mixin custom-scrollbar($theme: light, $size: 7px, $borderSpacing: 5px) {
$themes: (
light: #5f6064,
dark: #bbb,
);
$scrollBarColor: if(map_has_key($themes, $theme), map_get($themes, $theme), none);
$scrollBarSize: calc(#{$size} + #{$borderSpacing} * 2);
overflow: auto; // allow scrolling for container
// Webkit
&::-webkit-scrollbar {
width: $scrollBarSize;
height: $scrollBarSize;
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: $scrollBarColor;
background-clip: padding-box;
border: $borderSpacing solid transparent;
border-radius: $scrollBarSize;
}
&::-webkit-scrollbar-corner {
background-color: transparent;
}
}
// Hide scrollbar but keep the element scrollable
@mixin hidden-scrollbar {
overflow: auto;