pocketbase/ui/src/scss/_mixins.scss

65 lines
1.6 KiB
SCSS
Raw Normal View History

2022-07-07 05:19:05 +08:00
@mixin hide() {
opacity: 0;
visibility: hidden;
}
@mixin show() {
opacity: 1;
visibility: visible;
}
@mixin shadowize($value...) {
box-shadow: 0px 2px 5px 0px var(--shadowColor), $value;
}
2022-08-06 04:25:16 +08:00
@mixin scrollbar(
$width: 8px,
$thumbColor: var(--baseAlt2Color),
$thumbActiveColor: var(--baseAlt3Color)
) {
2022-07-07 05:19:05 +08:00
$trackColor: transparent;
2022-08-06 04:25:16 +08:00
$elem: if(&, '&', '');
2022-07-07 05:19:05 +08:00
@media screen and (min-width: 550px) {
// chrome scrollbar styles
2022-08-06 04:25:16 +08:00
#{$elem}::-webkit-scrollbar {
2022-07-07 05:19:05 +08:00
width: $width;
height: $width;
border-radius: var(--baseRadius);
}
2022-08-06 04:25:16 +08:00
#{$elem}::-webkit-scrollbar-track {
2022-07-07 05:19:05 +08:00
background: $trackColor;
border-radius: var(--baseRadius);
}
2022-08-06 04:25:16 +08:00
#{$elem}::-webkit-scrollbar-thumb {
background-color: $thumbColor;
2022-07-07 05:19:05 +08:00
border-radius: 15px;
border: 2px solid transparent;
background-clip: padding-box;
&:hover,
&:active {
2022-08-06 04:25:16 +08:00
background-color: $thumbActiveColor;
2022-07-07 05:19:05 +08:00
}
}
@if & {
// firefox scrollbar
2022-08-06 04:25:16 +08:00
scrollbar-color: $thumbColor $trackColor;
2022-07-07 05:19:05 +08:00
scrollbar-width: thin;
scroll-behavior: smooth;
} @else {
html {
// firefox scrollbar
2022-08-06 04:25:16 +08:00
scrollbar-color: $thumbColor $trackColor;
2022-07-07 05:19:05 +08:00
scrollbar-width: thin;
scroll-behavior: smooth;
* {
scrollbar-width: inherit;
}
}
}
}
}