Debian Codegraph @

src/gtk4/widgets/_scrollbar.scss

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