Skip to content

Commit

Permalink
Styles: add scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Mar 22, 2024
1 parent 0491f2d commit 374774d
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Styles/Gtk/Index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import 'HeaderBar.scss';
@import 'Image.scss';
@import 'Popover.scss';
@import 'Scrollbar.scss';
@import 'ShortcutsWindow.scss';
@import 'Spinner.scss';
@import 'Tooltip.scss';
Expand Down
89 changes: 89 additions & 0 deletions lib/Styles/Gtk/Scrollbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
scrollbar {
// Can't be taller than menuitem or popover is too big
$slider-length: rem(20px);
$slider-width: rem(3px);
$slider-width-full: rem($window_radius);

slider {
background-color: rgba($fg-color, 0.7);
box-shadow: 0 0 0 1px rgba(bg-color(2), 0.25);
border-radius: 99px;
transition:
background duration("collapse") easing(),
min-width duration("collapse") easing();
}

trough {
background-color: rgba($fg-color, 0.2);
border-radius: 99px;
margin: rem(3px);
}

&:hover,
&.hovering {
slider {
background-color: rgba($fg-color, 0.7);
transition:
background duration("expand") easing(),
min-width duration("expand") easing();
}
}

&:active {
slider {
background-color: $fg-color;
transition: background duration("expand") easing();
}
}

&.horizontal {
slider {
min-width: $slider-length;
min-height: $slider-width-full;
}
}

&.vertical {
slider {
min-height: $slider-length;
min-width: $slider-width-full;
}
}

&.overlay-indicator {
trough {
background-color: transparent;
transition:
background duration("expand") easing();
}

&:hover trough,
&.hovering trough {
background-color: rgba($fg-color, 0.2);
transition:
background duration("expand") easing();
}

&.horizontal {
slider {
min-height: $slider-width;
}

&:hover slider,
&.hovering slider {
min-height: $slider-width-full;
}
}

&.vertical {
slider {
min-width: $slider-width;
}

&:hover slider,
&.hovering slider {
min-width: $slider-width-full;
}
}
}
}

0 comments on commit 374774d

Please sign in to comment.