Debian Codegraph @

src/gtk4/widgets/_notebook.scss

raw
1 @charset "UTF-8";
2
3 /*****************
4 * Notebooks and *
5 * Tabs *
6 *****************/
7 /*************
8 * Notebooks *
9 *************/
10 notebook {
11 &.frame {
12 border: none;
13 padding: 0px;
14 box-shadow: inset 0px 0px 0px 1px gtk("@borders");
15 }
16
17 > header {
18 padding: 0px;
19 border: none;
20 background-color: gtk("@theme_bg_color");
21 //box-shadow: inset 0 -1px gtk("@borders");
22
23 &.top {
24 box-shadow: inset 0 -1px gtk("@borders"); // border
25 &:backdrop {
26 box-shadow: inset 0 -1px gtk("@unfocused_borders");
27 }
28 }
29 &.bottom {
30 box-shadow: inset 0 1px gtk("@borders");
31 &:backdrop {
32 box-shadow: inset 0 1px gtk("@unfocused_borders");
33 }
34 }
35 &.right {
36 box-shadow: inset 1px 0 gtk("@borders");
37 &:backdrop {
38 box-shadow: inset 1px 0 gtk("@unfocused_borders");
39 }
40 }
41 &.left {
42 box-shadow: inset -1px 0 gtk("@borders");
43 &:backdrop {
44 box-shadow: inset -1px 0 gtk("@unfocused_borders");
45 }
46 }
47 &:backdrop {
48 background-color: gtk("@theme_unfocused_bg_color");
49 }
50
51 tabs {
52 margin: 0px;
53 }
54
55 @each $_tab, $_border,
56 $_radius_first, $_radius_last in (top, bottom, 3px 0px 0px 0px, 0px 3px 0px 0px),
57 (bottom, top, 0px 0px 0px 3px, 0px 0px 3px 0px),
58 (left, right, 3px 0px 0px 0px, 0px 0px 0px 3px),
59 (right, left, 0px 3px 0px 0px, 0px 0px 3px 0px)
60 {
61 &.#{$_tab} {
62 > tabs {
63 > tab {
64 padding: 4px 6px;
65 padding-bottom: 7px;
66 border: 1px
67 solid
68 transparent;
69 border-#{$_border}: none;
70 border-#{$_tab}: 3px solid transparent;
71 background-color: gtkalpha(
72 gtk("@theme_fg_color"),
73 0.2
74 );
75 border-radius: 0;
76
77
78 &:first-child {
79 border-radius: $_radius_first;
80 }
81
82 &:last-child {
83 border-radius: $_radius_last;
84 }
85
86 &:hover,
87 &.prelight-page {
88 transition: 0.15s;
89 background-color: gtkalpha(
90 gtk("@theme_selected_bg_color"),
91 0.2
92 );
93
94 }
95
96 // Padding trickery to get selected tab overlap
97 @if $_tab == top or $_tab == bottom {
98
99 > label {
100 margin-left: -3px;
101 }
102
103 &:checked {
104 padding-left: 9px;
105
106 &:not(:first-child) {
107 margin-left: -3px;
108 }
109
110 &:first-child {
111 padding-left: 6px;
112 }
113 &:not(:last-child) {
114 margin-right: -3px;
115 }
116
117 & + tab {
118 padding-left: 9px;
119 }
120 }
121 } @else {
122
123 > label {
124 margin-top: -3px;
125 }
126
127 &:checked {
128 padding-top: 7px;
129
130 &:not(:first-child) {
131 margin-top: -3px;
132 }
133 &:first-child {
134 padding-top: 4px;
135 }
136 &:not(:last-child) {
137 margin-bottom: -3px;
138 }
139
140 & + tab {
141 padding-top: 7px;
142 }
143 }
144 }
145
146 &:checked {
147 transition: none;
148 border-color: gtk("@borders");
149 border-#{$_tab}-color: gtk("@theme_selected_bg_color");
150
151 $_radius: ();
152
153 // Combine both first and second radiuses
154 @for $i from 1 through length($_radius_first) {
155 $_radius: append($_radius, nth($_radius_first, $i) + nth($_radius_last, $i));
156 }
157
158 border-radius: $_radius;
159
160 background-color: gtk("@theme_bg_color");
161 }
162 }
163
164 arrow.down ~ tab:checked:nth-child(2) {
165 @if $_tab == top or $_tab == bottom {
166 margin-left: 0px;
167 padding-left: 6px;
168 } @else {
169 margin-top: 0px;
170 padding-top: 4px;
171 }
172 }
173
174 arrow.down ~ tab:checked:nth-last-child(2) {
175 @if $_tab == top or $_tab == bottom {
176 margin-right: 0px;
177 } @else {
178 margin-bottom: 0px;
179 }
180 }
181 }
182 }
183 }
184
185 @each $_tab, $_border,
186 $_shadow1 in (top, right, -3px 0px 0px 0px),
187 (bottom, right, -3px 0px 0px 0px),
188 (left, bottom, 0px -3px 0px 0px),
189 (right, bottom, 0px -3px 0px 0px)
190 {
191 &.#{$_tab} {
192 > tabs {
193 > tab {
194 &.reorderable-page {
195 border-width: 3px;
196 border-style: solid;
197 border-color: transparent;
198 background-color: gtk("@theme_bg_color");
199 background-clip: padding-box;
200 border-#{$_border}-width: 1px;
201 border-#{$_border}-color: gtk("@borders");
202 box-shadow: inset
203 #{$_shadow1}
204 gtk("@theme_bg_color");
205 &:hover,
206 &.prelight-page {
207 box-shadow: inset
208 0px -3px
209 0px
210 0px
211 gtkalpha(
212 gtk("@theme_selected_bg_color"),
213 0.2
214 ),
215 inset $_shadow1 gtk("@theme_bg_color");
216 }
217 &:checked {
218 box-shadow: inset
219 0px -3px
220 0px
221 0px
222 gtk("@theme_selected_bg_color"),
223 inset $_shadow1 gtk("@theme_bg_color");
224 &:backdrop {
225 background-color: gtk(
226 "@theme_unfocused_bg_color"
227 );
228 border-color: transparent;
229 border-#{$_border}-color: gtk(
230 "@unfocused_borders"
231 );
232 box-shadow: none;
233 }
234 }
235 &:backdrop {
236 background-color: gtk(
237 "@theme_unfocused_bg_color"
238 );
239 border-#{$_border}-color: gtk(
240 "@unfocused_borders"
241 );
242 box-shadow: none;
243 }
244 }
245 }
246 }
247 }
248 }
249
250 &.top > tabs > arrow {
251 @extend %notebook_vert_arrows;
252
253 border-top-style: none;
254 }
255
256 &.bottom > tabs > arrow {
257 @extend %notebook_vert_arrows;
258
259 border-bottom-style: none;
260 }
261
262 @at-root %notebook_vert_arrows {
263 margin-left: -5px;
264 margin-right: -5px;
265 padding-left: 4px;
266 padding-right: 4px;
267
268 &.down {
269 -gtk-icon-source: -gtk-icontheme($arrow_left);
270 }
271
272 &.up {
273 -gtk-icon-source: -gtk-icontheme($arrow_right);
274 }
275 }
276
277 &.left > tabs > arrow {
278 @extend %notebook_horz_arrows;
279
280 border-left-style: none;
281 }
282
283 &.right > tabs > arrow {
284 @extend %notebook_horz_arrows;
285
286 border-right-style: none;
287 }
288
289 @at-root %notebook_horz_arrows {
290 margin-top: -5px;
291 margin-bottom: -5px;
292 padding-top: 4px;
293 padding-bottom: 4px;
294
295 &.down {
296 -gtk-icon-source: -gtk-icontheme($arrow_up);
297 }
298
299 &.up {
300 -gtk-icon-source: -gtk-icontheme($arrow_down);
301 }
302 }
303
304 > tabs > arrow {
305 @include neobutton(toolbutton);
306
307 min-height: 16px;
308 min-width: 16px;
309 border-radius: 0;
310
311 &:hover:not(:active):not(:backdrop) {
312 background-clip: padding-box;
313 background-image: none;
314 background-color: transparentize(white, 0.7);
315 border-color: transparent;
316 box-shadow: none;
317 }
318 }
319
320 // colors the button like the label, overridden otherwise
321 button.flat {
322 padding: 0;
323 margin: 2px;
324 // FIXME: generalize .small-button?
325 min-width: 12px;
326 min-height: 12px;
327 border: 0px solid;
328 border-radius: 50%;
329 color: gtk("@borders");
330 background-image: none;
331
332 &:active,
333 &:hover{
334 color: $error_color;
335 }
336 }
337 }
338
339 > stack:not(:only-child) {
340 // the :not(:only-child) is for "hidden" notebooks
341 background-color: transparent;
342 border-style: solid;
343 border-color: gtk("@borders");
344 border-width: 0px;
345 }
346 }