| 1 |
@charset "UTF-8"; |
| 2 |
|
| 3 |
/************** |
| 4 |
* Scrollbars * |
| 5 |
**************/ |
| 6 |
|
| 7 |
scrollbar { |
| 8 |
-GtkScrollbar-has-backward-stepper: false; |
| 9 |
-GtkScrollbar-has-forward-stepper: false; |
| 10 |
|
| 11 |
background-color: gtk("@theme_bg_color"); |
| 12 |
border-width: 0px; |
| 13 |
border-color: gtk("@theme_bg_color"); |
| 14 |
|
| 15 |
// Vertical padding (for vertical scroll bar, obviously) is done here for proper distance to the window border, |
| 16 |
// horizontal padding is done on the trough below to ensure its hit area touches the window side. |
| 17 |
padding: 5px 0px; |
| 18 |
|
| 19 |
&.vertical { |
| 20 |
|
| 21 |
&:dir(rtl) { |
| 22 |
border-right: 1px solid gtk("@borders"); |
| 23 |
} |
| 24 |
|
| 25 |
&:dir(ltr) { |
| 26 |
border-left: 1px solid gtk("@borders"); |
| 27 |
} |
| 28 |
|
| 29 |
&.right { |
| 30 |
&:dir(rtl) { |
| 31 |
border-right: none; |
| 32 |
} |
| 33 |
border-left: 1px solid gtk("@borders"); |
| 34 |
} |
| 35 |
|
| 36 |
&.left { |
| 37 |
&:dir(ltr) { |
| 38 |
border-left: none; |
| 39 |
} |
| 40 |
border-right: 1px solid gtk("@borders"); |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
&.horizontal { |
| 45 |
border-top: 1px solid gtk("@borders"); |
| 46 |
|
| 47 |
padding: 0px 5px; |
| 48 |
|
| 49 |
&.bottom { |
| 50 |
border-top: 1px solid gtk("@borders"); |
| 51 |
} |
| 52 |
|
| 53 |
&.top { |
| 54 |
border-top: none; |
| 55 |
border-bottom: 1px solid gtk("@borders"); |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
button { |
| 60 |
min-width: 14px; |
| 61 |
min-height: 14px; |
| 62 |
margin: 0px; |
| 63 |
padding: 0px 0px; |
| 64 |
border: none; |
| 65 |
border-radius: 0px; |
| 66 |
background-image: none; |
| 67 |
background-color: transparent; |
| 68 |
color: transparent; |
| 69 |
box-shadow: none; |
| 70 |
&:hover { |
| 71 |
border: none; |
| 72 |
background-image: none; |
| 73 |
background-color: gtk("@theme_bg_color"); |
| 74 |
color: transparent; |
| 75 |
} |
| 76 |
&:active, |
| 77 |
&:active:hover { |
| 78 |
border: none; |
| 79 |
background-image: none; |
| 80 |
background-color: gtk("@theme_bg_color"); |
| 81 |
color: transparent; |
| 82 |
} |
| 83 |
&:disabled { |
| 84 |
border: none; |
| 85 |
background-color: gtk("@theme_bg_color"); |
| 86 |
background-image: none; |
| 87 |
color: transparent; |
| 88 |
} |
| 89 |
} |
| 90 |
|
| 91 |
// Overlay Scrollbars |
| 92 |
&.dragging, // if this isn't set, the scrollbars don't update their size correctly |
| 93 |
&.hovering { |
| 94 |
opacity: 0.991; |
| 95 |
} // probably a gtk bug |
| 96 |
&.overlay-indicator:not(.dragging):not(.hovering) { |
| 97 |
opacity: 0.999; |
| 98 |
} // |
| 99 |
|
| 100 |
&.overlay-indicator:not(.dragging):not(.hovering) { |
| 101 |
-GtkScrollbar-has-backward-stepper: false; |
| 102 |
-GtkScrollbar-has-forward-stepper: false; |
| 103 |
} |
| 104 |
|
| 105 |
&.overlay-indicator { |
| 106 |
border: none; |
| 107 |
|
| 108 |
&.vertical { |
| 109 |
border:none; |
| 110 |
} |
| 111 |
|
| 112 |
&.horizontal { |
| 113 |
border:none; |
| 114 |
} |
| 115 |
|
| 116 |
background: none; |
| 117 |
|
| 118 |
slider { |
| 119 |
background-image: gtkoverlayalpha(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.5*0.7), 0.75); |
| 120 |
} |
| 121 |
} |
| 122 |
|
| 123 |
trough { |
| 124 |
// Complements the padding on the scrollbar itself. |
| 125 |
margin: 0px 5px; |
| 126 |
min-width: 6px; |
| 127 |
min-height: 14px; |
| 128 |
background-color: transparent; |
| 129 |
} |
| 130 |
|
| 131 |
&:hover { |
| 132 |
trough { |
| 133 |
slider { |
| 134 |
background-image: gtkoverlay(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.5)); |
| 135 |
box-shadow: 0 0 0 1px gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.9) inset; |
| 136 |
|
| 137 |
&:hover { |
| 138 |
background-image: gtkoverlay(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_decoration_hover"), 0.5)); |
| 139 |
box-shadow: 0 0 0 1px gtkalpha(gtk("@theme_button_decoration_hover"), 0.9) inset; |
| 140 |
} |
| 141 |
} |
| 142 |
} |
| 143 |
} |
| 144 |
|
| 145 |
&.horizontal trough { |
| 146 |
margin: 5px 0px; |
| 147 |
min-width: 14px; |
| 148 |
min-height: 6px; |
| 149 |
} |
| 150 |
|
| 151 |
*:focus ~ &, |
| 152 |
& ~ *:focus{ |
| 153 |
|
| 154 |
&:hover { |
| 155 |
slider { |
| 156 |
background-image: gtkoverlay(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_decoration_hover"), 0.5)); |
| 157 |
box-shadow: 0 0 0 1px gtkalpha(gtk("@theme_button_decoration_hover"), 0.9) inset; |
| 158 |
} |
| 159 |
} |
| 160 |
|
| 161 |
&.overlay-indicator { |
| 162 |
slider { |
| 163 |
background-image: gtkoverlayalpha(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_decoration_focus"), 0.5*0.7), 0.75); |
| 164 |
} |
| 165 |
|
| 166 |
&:hover { |
| 167 |
slider { |
| 168 |
background-image: gtkoverlay(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_decoration_hover"), 0.5)); |
| 169 |
box-shadow: 0 0 0 1px gtkalpha(gtk("@theme_button_decoration_hover"), 0.9) inset; |
| 170 |
} |
| 171 |
} |
| 172 |
} |
| 173 |
} |
| 174 |
|
| 175 |
slider { |
| 176 |
transition-duration: 0.1s; |
| 177 |
min-width: 6px; |
| 178 |
min-height: 30px; |
| 179 |
border-radius: 15px; |
| 180 |
background-clip: padding-box; |
| 181 |
background-image: gtkoverlay(gtk("@theme_bg_color"), gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.5*0.7)); |
| 182 |
box-shadow: 0 0 0 1px gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.7*0.9) inset; |
| 183 |
} |
| 184 |
|
| 185 |
// GTK WebKit scrollbar paint code cannot deal with negative margins properly, |
| 186 |
// causing the scrollbar slider turn invisible. |
| 187 |
:not(webkitwebview) & slider { |
| 188 |
margin: -9px; |
| 189 |
margin-bottom: -6px; |
| 190 |
margin-top: -6px; |
| 191 |
// To keep the ability to drag the slider from the edge of the screen |
| 192 |
border: 5px solid transparent; |
| 193 |
} |
| 194 |
|
| 195 |
&.horizontal slider { |
| 196 |
transition-duration: 0.1s; |
| 197 |
min-width: 30px; |
| 198 |
min-height: 6px; |
| 199 |
} |
| 200 |
|
| 201 |
:not(webkitwebview) &.horizontal slider { |
| 202 |
margin: -9px; |
| 203 |
margin-left: -6px; |
| 204 |
margin-right: -6px; |
| 205 |
} |
| 206 |
} |