Debian Codegraph @

common/gtk-4.0/sass/_common.scss

raw
1 @function gtkalpha($c,$a) {
2 @return unquote("alpha(#{$c},#{$a})");
3 }
4
5 $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
6 $backdrop_transition: 200ms ease-out;
7 $button_transition: all 200ms $ease-out-quad, outline-width 0s;
8 $header_radius: if($variant=='light' or $variant=='lighter', 4px, 3px);
9 $scale_trough_bg: if($variant != 'dark', $button_border, darken($bg_color, 5%));
10
11 $asset_suffix: if($variant=='dark', '-dark', '');
12 $darker_asset_suffix: if($variant=='darker', '-dark', $asset_suffix);
13
14 /***************
15 * Base States *
16 ***************/
17 .background {
18 color: $fg_color;
19 background-color: if($transparency == 'true', transparentize($bg_color, 0.001), $bg_color); // without this headerbar transparency doesn't seem to work
20 }
21
22 dnd {
23 color: $fg_color;
24 }
25
26 .normal-icons {
27 -gtk-icon-size: 16px;
28 }
29
30 .large-icons {
31 -gtk-icon-size: 32px;
32 }
33
34 image:disabled {
35 -gtk-icon-filter: opacity(0.5);
36 }
37
38 .view,
39 %view {
40 color: $text_color;
41 background-color: $base_color;
42
43 &:disabled {
44 color: $insensitive_fg_color;
45 background-color: $insensitive_bg_color;
46 }
47
48 &:selected {
49 &:focus, & {
50 @extend %selected_items;
51
52 border-radius: 2px;
53 }
54 }
55 }
56
57 textview {
58 > text {
59 @extend %view;
60
61 background-color: transparent;
62
63 > selection { &:focus, & { @extend %selected_items; }}
64 }
65
66 &:drop(active) {
67 caret-color: $drop_target_color;
68 }
69 }
70
71 textview > border { background-color: mix($bg_color, $base_color, 50%); }
72
73 iconview {
74 @extend .view;
75
76 @include focus-ring();
77
78 &:drop(active) {
79 box-shadow: none;
80 }
81
82 > dndtarget:drop(active) {
83 border-style: solid;
84 border-width: 1px;
85 border-color: $selected_borders_color;
86 }
87 }
88
89 rubberband {
90 border: 1px solid darken($selected_bg_color, 10%);
91 background-color: transparentize(darken($selected_bg_color, 10%), 0.8);
92 }
93
94 flowbox {
95 > rubberband { @extend rubberband; }
96
97 > flowboxchild {
98 padding: 3px;
99 border-radius: 2px;
100
101 @include focus-ring();
102
103 &:selected {
104 @extend %selected_items;
105 }
106 }
107 }
108
109 gridview {
110 > rubberband { @extend rubberband; }
111
112 > child {
113 padding: 3px;
114 border-radius: 2px;
115
116 @include focus-ring();
117
118 &:selected {
119 @extend %selected_items;
120 }
121
122 box { //cells
123 border-spacing: 8px; //label separation
124 margin: 12px;
125 }
126 }
127 }
128
129 coverflow cover {
130 color: $text_color;
131 background-color: $base_color;
132 border: 1px solid black;
133 }
134
135 label {
136 @include focus-ring();
137
138 &.separator {
139 @extend .dim-label;
140
141 color: $fg_color;
142 }
143
144 &:selected { @extend %nobg_selected_items; }
145
146 > selection {
147 background-color: $selected_bg_color;
148 color: $selected_fg_color;
149 }
150
151 &:disabled {
152 color: $insensitive_fg_color;
153
154 button & { color: inherit; }
155
156 > selection { @extend %selected_items_disabled; }
157 }
158
159 &.error {
160 color: $error_color;
161 &:disabled { color: transparentize($error_color,0.5); }
162 }
163 }
164
165 .dim-label {
166 opacity: 0.55;
167 text-shadow: none;
168 }
169
170 window.assistant {
171 .sidebar {
172 border-top: 1px solid $borders_color;
173 }
174
175 &.csd .sidebar { border-top-style: none; }
176
177 .sidebar > label { padding: 6px 12px; }
178
179 .sidebar > label.highlight {
180 color: $selected_fg_color;
181 background-color: $selected_bg_color;
182 }
183 }
184
185 window.aboutdialog image.large-icons {
186 -gtk-icon-size: 128px;
187 }
188
189 %osd,
190 .osd {
191 color: $osd_fg_color;
192 border: none;
193 background-color: $osd_bg_color;
194 background-clip: padding-box;
195 text-shadow: none;
196 -gtk-icon-shadow: none;
197 }
198
199 /*********************
200 * Spinner Animation *
201 *********************/
202 @keyframes spin {
203 to { transform: rotate(1turn); }
204 }
205
206 spinner {
207 background: none;
208 opacity: 0; // non spinning spinner makes no sense
209 -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
210
211 &:checked {
212 opacity: 1;
213 animation: spin 1s linear infinite;
214
215 &:disabled { opacity: 0.5; }
216 }
217 }
218
219 /**********************
220 * General Typography *
221 **********************/
222 .large-title {
223 font-weight: 300;
224 font-size: 24pt;
225 }
226 .title-1 {
227 font-weight: 800;
228 font-size: 20pt;
229 }
230 .title-2 {
231 font-weight: 800;
232 font-size: 15pt;
233 }
234 .title-3 {
235 font-weight: 700;
236 font-size: 15pt;
237 }
238 .title-4 {
239 font-weight: 700;
240 font-size: 13pt;
241 }
242 .heading {
243 font-weight: 700;
244 font-size: 11pt;
245 }
246 .body {
247 font-weight: 400;
248 font-size: 11pt;
249 }
250 .caption-heading {
251 font-weight: 700;
252 font-size: 9pt;
253 }
254 .caption {
255 font-weight: 400;
256 font-size: 9pt;
257 }
258
259 /****************
260 * Text Entries *
261 ****************/
262
263 %entry,
264 entry {
265 %entry_basic, & {
266 min-height: 26px;
267 padding-left: 8px;
268 padding-right: 8px;
269 border: 1px solid;
270 border-radius: 3px;
271 border-spacing: 5px;
272 transition: all 200ms $ease-out-quad;
273 background-clip: padding-box;
274
275 &.search { border-radius: 20px; }
276
277 @include entry(normal);
278
279 > image { // icons inside the entry
280 &.left { margin-right: 5px; }
281 &.right { margin-left: 5px; }
282 }
283
284 > text > placeholder {
285 @extend .dim-label;
286 }
287
288 > text > block-cursor {
289 @include entry(block_cursor);
290 }
291
292 &.flat {
293 &:focus-within, &:disabled, & {
294 min-height: 0;
295 padding: 2px;
296 background-color: transparent;
297 border-color: transparent;
298 border-radius: 0;
299 }
300 }
301
302 &:focus-within {
303 background-clip: border-box;
304 @include entry(focus);
305 > placeholder {
306 opacity: 0; /* We hide placeholders on focus */
307 }
308 }
309
310 &:disabled { @include entry(insensitive); }
311
312 > text > selection { @extend %selected_items; }
313
314 // entry error and warning style
315 @each $e_type, $e_color, $e_fg_color in (error, $error_color, $error_fg_color),
316 (warning, $warning_color, $warning_fg_color) {
317 &.#{$e_type} {
318 color: $e_fg_color;
319 border-color: if($variant!='dark', $e_color, $entry_border);
320 background-color: mix($e_color, $base_color, 60%);
321
322 > image { color: $e_fg_color; }
323
324 &:focus-within {
325 color: $e_fg_color;
326 background-color: $e_color;
327 box-shadow: none;
328 }
329
330 > selection {
331 background-color: $e_fg_color;
332 color: $e_color;
333 }
334 }
335 }
336
337 > image { // entry icons colors
338 color: mix($fg_color, $base_color, 80%);
339 }
340
341 &.password image.caps-lock-indicator {
342 color: mix($fg_color, $base_color, 80%);
343 }
344
345 &:drop(active) {
346 &:focus-within, & {
347 border-color: $drop_target_color;
348 box-shadow: none;
349 }
350 }
351
352 .osd & {
353 @include entry(osd);
354
355 &:focus-within { @include entry(osd-focus); }
356
357 &:disabled { @include entry(osd-insensitive); }
358
359 selection {
360 color: $selected_bg_color;
361 background-color: $selected_fg_color;
362 }
363 }
364 }
365
366 > progress {
367 margin-bottom: 2px;
368 }
369
370 progress > trough > progress {
371 background-color: transparent;
372 background-image: none;
373 border-radius: 0;
374 border-width: 0 0 2px;
375 border-color: $selected_bg_color;
376 border-style: solid;
377 box-shadow: none;
378
379 }
380
381 // linked entries
382 .linked:not(.vertical) > & { @extend %linked; }
383
384 // Vertically linked entries
385 .linked.vertical > & { @extend %linked_vertical; }
386
387 &.error { color: $error_color; }
388 }
389
390 treeview entry {
391 &:focus-within {
392 &:dir(rtl), &:dir(ltr) { // specificity bump hack
393 background-color: $base_color;
394 }
395 }
396
397 &.flat, & {
398 border-radius: 0;
399 background-image: none;
400 background-color: $base_color;
401
402 &:focus-within { border-color: $selected_bg_color; }
403 }
404 }
405
406 /*******************
407 * Editable Labels *
408 *******************/
409 editablelabel > stack > text {
410 @include entry(normal);
411 }
412
413 /***********
414 * Buttons *
415 ***********/
416 // stuff for .needs-attention
417 $_dot_color: $selected_bg_color;
418 @keyframes needs_attention {
419 from { background-image: radial-gradient(farthest-side, $_dot_color 0%, transparentize($_dot_color, 1) 0%); }
420 to { background-image: radial-gradient(farthest-side, $_dot_color 95%, transparentize($_dot_color, 1)); }
421 }
422
423 %button,
424 button {
425 @at-root %button_basic, & {
426
427 min-height: 22px;
428 min-width: 20px;
429 padding: 2px 6px;
430 border: 1px solid;
431 border-radius: 3px;
432 transition: $button_transition;
433 background-clip: padding-box;
434
435 @include button(normal);
436
437 @include focus-ring();
438
439 &:hover {
440 @include button(hover);
441 -gtk-icon-filter: brightness(1.2);
442 }
443
444 &.keyboard-activating,
445 &:active,
446 &:checked {
447 @include button(active);
448
449 background-clip: if($variant!='dark', border-box, padding-box);
450
451 &:not(:disabled) label:disabled { color: inherit; opacity: 0.6; }
452 }
453
454 &:checked:hover { @include button(active); }
455 &:checked:active { @include button(active); }
456
457 &:disabled {
458 @include button(insensitive);
459 -gtk-icon-filter: opacity(0.5);
460
461 &:active,
462 &:checked { @include button(insensitive-active); }
463 }
464
465 @at-root %button_basic_flat,
466 &.flat {
467 @include button(undecorated);
468 // to avoid adjacent buttons borders clashing when transitioning, the transition on the normal state is set
469 // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but
470 // it won't fade out when the pointer leave the button allocation area. To make the transition more evident
471 // in this case the duration is increased.
472 transition: none;
473
474 &:hover {
475 @include button(hover);
476 transition: $button_transition;
477 transition-duration: 500ms;
478 }
479 &.keyboard-activating,
480 &:active,
481 &:checked {
482 @include button(active);
483 transition: $button_transition;
484 }
485 &:disabled { @include button(undecorated); }
486 }
487
488 &.image-button {
489 min-width: 24px;
490 padding-left: 5px;
491 padding-right: 5px;
492 }
493
494 &.text-button {
495 padding-left: 12px;
496 padding-right: 12px;
497 }
498
499 %image_text_button,
500 &.text-button.image-button {
501 padding-left: 5px;
502 padding-right: 5px;
503
504 label {
505 padding-left: 2px;
506 padding-right: 2px;
507
508 &:first-child {
509 padding-left: 7px;
510 padding-right: 2px;
511 }
512 &:last-child {
513 padding-right: 7px;
514 padding-left: 2px;
515 }
516 &:only-child {
517 padding-left: 7px;
518 padding-right: 7px;
519 }
520 }
521
522 &.popup { padding-right: 7px; padding-left: 7px; }
523 }
524
525 &.arrow-button {
526 padding-left: 10px;
527 padding-right: 10px;
528
529 > box {
530 border-spacing: 4px;
531 }
532 }
533
534 @at-root %button_basic_drop_active,
535 &:drop(active) {
536 color: $drop_target_color;
537 border-color: $drop_target_color;
538 box-shadow: none;
539 }
540 }
541
542 // big standalone buttons like in Documents pager
543 &.osd {
544 min-width: 26px;
545 min-height: 32px;
546
547 &.image-button { min-width: 34px; }
548
549 color: $osd_fg_color;
550 background-color: $osd_bg_color;
551 border-color: darken($osd_bg_color, 8%);
552 border-radius: 5px;
553
554 box-shadow: none;
555
556 &:hover {
557 color: $selected_bg_color;
558
559 border: none;
560 box-shadow: none;
561 }
562
563 &:active,
564 &:checked {
565 @include button(osd-active);
566
567 border: none;
568 box-shadow: none;
569 }
570
571 &:disabled {
572 @include button(osd-insensitive);
573
574 border: none;
575 }
576 }
577
578 //overlay / OSD style
579 @at-root %osd_button,
580 .osd & {
581 @include button(osd);
582
583 &:hover { @include button(osd-hover); }
584
585 &:active,
586 &:checked {
587 background-clip: padding-box;
588 @include button(osd-active);
589 }
590
591 &:disabled { @include button(osd-insensitive); }
592
593 &.flat {
594 @include button(undecorated);
595
596 box-shadow: none;
597 text-shadow: none;
598 -gtk-icon-shadow: none;
599
600 &:hover { @include button(osd-hover); }
601
602 &:disabled {
603 @include button(osd-insensitive);
604 background-image: none;
605 border-color: transparent;
606 box-shadow: none;
607 }
608
609 &:active,
610 &:checked { @include button(osd-active); }
611 }
612 }
613
614 // Suggested and Destructive Action buttons
615 @each $b_type, $b_color, $b_fg in (suggested-action, $suggested_color, $suggested_fg_color),
616 (destructive-action, $destructive_color, $destructive_fg_color) {
617 &.#{$b_type} {
618 @include button(suggested_destructive, $b_color, $b_fg);
619 @include focus-ring();
620
621 &.flat {
622 @include button(undecorated);
623
624 color: $b_color;
625 }
626
627 &:hover { @include button(suggested_destructive, lighten($b_color, 10%), $b_fg); }
628
629 &:active,
630 &:checked { @include button(suggested_destructive, darken($b_color, 10%), $b_fg); }
631
632 &.flat {
633 &:disabled {
634 @include button(undecorated);
635
636 color: $insensitive_fg_color;
637 }
638 }
639
640 &:disabled {
641 @include button(insensitive);
642
643 &:active,
644 &:checked { @include button(insensitive-active); }
645 }
646
647 .osd & {
648 @include button(osd);
649
650 &:hover { @include button(osd-hover); }
651
652 &:active,
653 &:checked { @include button(osd-active); }
654
655 &:disabled { @include button(osd-insensitive); }
656 }
657 }
658 }
659
660 stackswitcher > & {
661 // to position the needs attention dot, padding is added to the button
662 // child, a label needs just lateral padding while an icon needs vertical
663 // padding added too.
664
665 > label {
666 padding: 0 6px;
667 margin: 0 -6px;
668 }
669
670 > image {
671 padding: 3px 6px;
672 margin: -3px -6px;
673 }
674
675 &.needs-attention {
676 > label,
677 > image { @extend %needs_attention; }
678 }
679 }
680
681 // hide separators
682 &.font{
683 separator { background-color: transparent; }
684 > box { border-spacing: 6px; }
685 > box > box > label { font-weight: bold; }
686 }
687
688 .linked:not(.vertical) > & { @extend %linked; }
689
690 .linked.vertical > & { @extend %linked_vertical; }
691
692 %circular_button,
693 menubutton.circular &,
694 &.circular { // force circular button shape
695 min-width: 24px;
696 min-height: 24px;
697 padding: 2px;
698 border-radius: 9999px;
699
700 label { padding: 0; }
701 }
702 }
703
704 // Some crazy linking stuff
705 @mixin linking_rules($a:0.7, $var:$variant, $vert:'false', $entry_rules:'true', $button_rules:'true',
706 $e_border:$entry_border, $b_border:$button_border) {
707
708 $_border: if($vert=='false', left, top);
709
710 @if $entry_rules=='true' {
711 > entry + entry { border-#{$_border}-color: transparentize($e_border, $a); }
712
713 > entry.error + entry,
714 > entry + entry.error { border-#{$_border}-color: if($var=='light', $error_color, transparentize($e_border, $a)); }
715
716 > entry.warning + entry,
717 > entry + entry.warning { border-#{$_border}-color: if($var=='light', $warning_color, transparentize($e_border, $a)); }
718
719 > entry.error + entry.warning,
720 > entry.warning + entry.error { border-#{$_border}-color: if($var=='light', mix($error_color, $warning_color, 50%), transparentize($e_border, $a));}
721
722 @each $e_type, $e_color in (':focus',$selected_bg_color),
723 (':drop(active)', $drop_target_color),
724 ('.warning:focus', $warning_color),
725 ('.error:focus', $error_color) {
726
727 > entry + entry#{$e_type}:not(:last-child),
728 > entry + entry#{$e_type}:last-child { border-#{$_border}-color: if($var=='light', $e_color, $e_border); }
729
730 > entry#{$e_type}:not(:only-child) {
731 + entry,
732 + button,
733 + combobox > box > button.combo { border-#{$_border}-color: if($var=='light', $e_color, $e_border); }
734 }
735 }
736 > button:active + entry,
737 > button:checked + entry { border-#{$_border}-color: if($var=='light', $selected_bg_color, $e_border); }
738 }
739 @if $button_rules=='true' {
740 $_uncolored_button: 'button:not(:checked):not(:active):not(.suggested-action):not(.destructive-action)';
741
742 > button + button { border-#{$_border}-style: none; }
743
744 > #{$_uncolored_button}:hover:not(:only-child),
745 > #{$_uncolored_button}:hover + #{$_uncolored_button} { box-shadow: inset if($vert=='false', 1px 0, 0 1px) $b_border; }
746
747 > #{$_uncolored_button}:disabled:not(:only-child),
748 > #{$_uncolored_button}:disabled + #{$_uncolored_button}:not(:hover) { box-shadow: inset if($vert=='false', 1px 0, 0 1px) transparentize($b_border, 0.5); }
749
750 > button:active + #{$_uncolored_button}:hover,
751 > button:checked + #{$_uncolored_button}:hover,
752 > button.suggested-action + #{$_uncolored_button}:hover,
753 > button.destructive-action + #{$_uncolored_button}:hover,
754 > entry + #{$_uncolored_button}:hover:not(:only-child),
755
756 > #{$_uncolored_button}:first-child:disabled,
757 > #{$_uncolored_button}:disabled + #{$_uncolored_button}:disabled,
758 > #{$_uncolored_button}:first-child:hover,
759 > button:active + #{$_uncolored_button}:disabled,
760 > button:checked + #{$_uncolored_button}:disabled,
761 > button.suggested-action + #{$_uncolored_button}:disabled,
762 > button.destructive-action + #{$_uncolored_button}:disabled,
763 > entry + #{$_uncolored_button}:disabled:not(:only-child), { box-shadow: none; }
764 }
765 }
766
767 // special case, because path-bars are bugged
768 @mixin pathbar_linking_rules($sep_color:if($variant!='dark', transparentize($button_border, 0.6), transparentize($button_border, 0.5))) {
769
770 > button + button { border-left-style: none; }
771
772 > button:hover:not(:checked):not(:active):not(:only-child) {
773
774 &:hover {
775 box-shadow: inset 1px 0 $sep_color,
776 inset -1px 0 $sep_color;
777 }
778 &:first-child:hover { box-shadow: inset -1px 0 $sep_color; }
779 &:last-child:hover { box-shadow: inset 1px 0 $sep_color; }
780 }
781 }
782
783 // Apply the rules defined above
784 .linked:not(.vertical) {
785 &:not(.path-bar) { @include linking_rules(); }
786 &.path-bar { @include pathbar_linking_rules(); }
787 }
788
789 .linked.vertical { @include linking_rules($vert:'true'); }
790
791 %needs_attention {
792 // the dot is drawn by using two radial gradient, the first one is the actual dot, the other
793 // simulates the shadow labels and icons normally have in buttons.
794 animation: needs_attention 150ms ease-in;
795
796 background-image: radial-gradient(farthest-side, $_dot_color 96%, transparentize($_dot_color,1 ));
797 background-size: 6px 6px, 6px 6px;
798 background-repeat: no-repeat;
799
800 @if $variant != 'dark' { background-position: right 3px, right 4px; }
801
802 @else { background-position: right 3px, right 2px; }
803
804 &:dir(rtl) {
805 @if $variant != 'dark' { background-position: left 3px, left 4px; }
806
807 @else { background-position: left 3px, left 2px; }
808 }
809 }
810
811
812 %linked_not_left {
813 border-top-left-radius: 0;
814 border-bottom-left-radius: 0;
815 }
816
817 %linked_not_right {
818 border-right-style: none;
819 border-top-right-radius: 0;
820 border-bottom-right-radius: 0;
821 }
822
823 // 1st/last child are at text start/end
824 %linked {
825 &:dir(ltr) {
826 &:not(:first-child) { @extend %linked_not_left; }
827 &:not(:last-child) { @extend %linked_not_right; }
828 }
829
830 &:dir(rtl) {
831 &:not(:first-child) { @extend %linked_not_right; }
832 &:not(:last-child) { @extend %linked_not_left; }
833 }
834 }
835
836 %linked_not_top {
837 border-top-left-radius: 0;
838 border-top-right-radius: 0;
839 }
840
841 %linked_not_bottom {
842 border-bottom-style: none;
843 border-bottom-left-radius: 0;
844 border-bottom-right-radius: 0;
845 }
846
847 %linked_vertical {
848 &:not(:first-child) { @extend %linked_not_top; }
849
850 &:not(:last-child) { @extend %linked_not_bottom; }
851 }
852
853 %undecorated_button {
854 background-color: transparent;
855 background-image: none;
856 border-color: transparent;
857 box-shadow: inset 0 1px transparentize(white, 1),
858 0 1px transparentize(white, 1);
859 text-shadow: none;
860 -gtk-icon-shadow: none;
861 }
862
863 .linked:not(.vertical) > menubutton,
864 .linked:not(.vertical) > dropdown,
865 .linked:not(.vertical) > colorbutton,
866 .linked:not(.vertical) > fontbutton,
867 .linked:not(.vertical) > filechooserbutton {
868 &:dir(ltr) {
869 &:not(:first-child) > button { @extend %linked_not_left; }
870 &:not(:last-child) > button { @extend %linked_not_right; }
871 }
872
873 &:dir(rtl) {
874 &:not(:first-child) > button { @extend %linked_not_right; }
875 &:not(:last-child) > button { @extend %linked_not_left; }
876 }
877 }
878
879 .linked.vertical > menubutton,
880 .linked.vertical > dropdown,
881 .linked.vertical > colorbutton,
882 .linked.vertical > fontbutton,
883 .linked.vertical > filechooserbutton {
884 &:not(:first-child) > button { @extend %linked_not_top; }
885 &:not(:last-child) > button { @extend %linked_not_bottom; }
886 }
887
888 /* menu buttons */
889 modelbutton.flat {
890 min-height: 24px;
891 padding-left: 8px;
892 padding-right: 8px;
893 border-radius: 2px;
894
895 @extend %undecorated_button;
896
897 &:disabled { color: $insensitive_fg_color; }
898
899 &:hover, &:selected { @extend %selected_items; }
900 }
901
902 modelbutton.flat arrow {
903 background: none;
904 min-width: 16px;
905 min-height: 16px;
906
907 &:hover { background: none; }
908
909 &.left { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
910
911 &.right { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
912 }
913
914 /* oldstyle toolbar buttons */
915
916 .toolbar > button,
917 .toolbar > :not(.linked) > button,
918 .toolbar :not(.linked) > menubutton > button,
919 .toolbar :not(.linked) > scalebutton > button,
920 .toolbar :not(.linked) > dropdown > button,
921 .toolbar :not(.linked) > colorbutton > button,
922 .toolbar :not(.linked) > fontbutton > button,
923 .toolbar :not(.linked) > appchooserbutton > button,
924 .toolbar :not(.linked) > combobox > box > button {
925 margin: 1px 0;
926 @extend %button_basic_flat;
927 }
928
929 button.color {
930 padding: 2px;
931
932 > colorswatch:only-child {
933 &, > overlay { border-radius: 0; }
934 }
935 }
936
937 /* list buttons */
938 %list_button,
939 list > row button.image-button:not(.flat) {
940 &:hover { @include button(hover); }
941 &:active,
942 &:checked { @include button(active); }
943
944 @each $b_type, $b_color, $b_fg in (suggested-action, $suggested_color, $suggested_fg_color),
945 (destructive-action, $destructive_color, $destructive_fg_color) {
946 &.#{$b_type} {
947 @include button(suggested_destructive, $b_color, $b_fg);
948 }
949 }
950 }
951
952 /*********
953 * Links *
954 *********/
955
956 %link,
957 link {
958 color: $link_color;
959 text-decoration: underline;
960
961 &:visited {
962 color: $link_visited_color;
963
964 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
965 }
966
967 &:hover {
968 color: lighten($link_color, 10%);
969
970 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
971 }
972
973 &:active {
974 color: $link_color;
975
976 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
977 }
978
979 &:disabled { color: transparentize(desaturate($link_color, 100%), 0.2); }
980
981 @at-root %link_selected,
982 &:selected,
983 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
984 }
985
986 link {
987 @include focus-ring();
988 }
989
990 button.link {
991 @extend %link;
992
993 &,
994 &:hover,
995 &:active,
996 &:checked {
997 @extend %undecorated_button;
998
999 text-shadow: none;
1000 }
1001
1002 > label {
1003 text-decoration: underline;
1004 }
1005 }
1006
1007 /*****************
1008 * GtkSpinButton *
1009 *****************/
1010 spinbutton {
1011
1012 button:active { color: $selected_fg_color; }
1013 &:disabled { color: $insensitive_fg_color; }
1014
1015 text { @extend %entry; }
1016
1017 &:not(.vertical) {
1018 text { min-width: 28px; }
1019
1020 button, text { @extend %linked; }
1021
1022 &:dir(ltr) text,
1023 &:dir(rtl) button.up { border-radius: 3px 0 0 3px; }
1024
1025 > button + button { border-left-style: none; }
1026
1027 > button:hover:not(:active),
1028 > button:hover:not(:active) + button { box-shadow: inset 1px 0 $button_border; }
1029
1030 > button:disabled + button:not(:disabled):not(:active):not(:checked):not(:hover),
1031 > button:not(:disabled):not(:active):not(:checked):not(:hover) + button:disabled { box-shadow: inset 1px 0 transparentize($button_border, 0.5); }
1032
1033 > button:first-child:hover:not(:active),
1034 > button.up:dir(rtl):hover:not(:active),
1035 > text + button:not(:active):hover { box-shadow: none; }
1036
1037 > text:focus + button { border-left-color: if($variant!='dark', $selected_bg_color, $entry_border); }
1038
1039 > text:drop(active) + button { border-left-color: $drop_target_color; }
1040
1041 .osd & {
1042 > button:hover:not(:active),
1043 > button:hover:not(:active) + button { box-shadow: inset 1px 0 $osd_button_border; }
1044
1045 > button:first-child:hover:not(:active),
1046 > button.up:dir(rtl):hover:not(:active),
1047 > text + button:not(:active):hover { box-shadow: none; }
1048
1049 > text:focus + button { border-left-color: $osd_button_border; }
1050 }
1051 }
1052 &.vertical {
1053 button, text {
1054 padding-left: 0;
1055 padding-right: 0;
1056 min-width: 0;
1057
1058 @extend %linked_vertical;
1059 }
1060
1061 button.up { border-radius: 3px 3px 0 0; }
1062
1063 > text:focus + button { border-top-color: if($variant!='dark', $selected_bg_color, $entry_border); }
1064
1065 > text:drop(active) + button { border-top-color: $drop_target_color; }
1066 }
1067
1068 font-feature-settings: "tnum";
1069 }
1070
1071 /**************
1072 * ComboBoxes *
1073 **************/
1074 dropdown > popover.menu.background > contents { padding: 0; } //allow search entries with no margin
1075
1076 dropdown > button > box {
1077 border-spacing: 6px;
1078
1079 > stack > row.activatable:hover {
1080 background: none;
1081 box-shadow: none;
1082 }
1083 }
1084
1085 dropdown,
1086 combobox {
1087 arrow {
1088 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1089 min-height: 16px;
1090 min-width: 16px;
1091 }
1092
1093 > popover.background.menu > contents {
1094 padding: 4px 0;
1095 border-radius: 2px;
1096 }
1097
1098 // align menu labels with the button label
1099 > popover.menu > contents modelbutton {
1100 min-height: 16px;
1101 padding: 5px 6px;
1102 border-radius: 0;
1103 }
1104
1105 &.linked {
1106 button:nth-child(2) {
1107 &:dir(ltr) { @extend %linked_not_left; }
1108 &:dir(rtl) { @extend %linked_not_right; }
1109 }
1110 }
1111
1112 &:drop(active) { // FIXME: untested
1113 box-shadow: none;
1114
1115 button.combo { @extend %button_basic_drop_active; }
1116 }
1117
1118 // newstyle
1119 popover {
1120 padding: 0;
1121
1122 listview.view {
1123 margin: 4px 0;
1124 background-color: transparent;
1125
1126 & > row {
1127 min-height: 16px;
1128 padding: 5px 6px;
1129
1130 &:selected {
1131 &, &:hover {
1132 color: $selected_fg_color;
1133 background-color: $selected_bg_color;
1134 }
1135 }
1136 }
1137 }
1138
1139 // drodowns with searchboxes on top
1140 .dropdown-searchbar {
1141 padding: 6px;
1142 border-bottom: 1px solid $borders_color;
1143 }
1144 }
1145 }
1146
1147
1148 // the combo is a composite widget so the way we do button linking doesn't
1149 // work, special case needed. See
1150 // https://bugzilla.gnome.org/show_bug.cgi?id=733979
1151
1152 .linked:not(.vertical) > filechooserbutton > combobox,
1153 .linked:not(.vertical) > appchooserbutton > combobox,
1154 .linked:not(.vertical) > combobox {
1155 &:dir(ltr) {
1156 &:not(:first-child) > box > button.combo { @extend %linked_not_left; }
1157 &:not(:last-child) > box > button.combo { @extend %linked_not_right; }
1158 }
1159
1160 &:dir(rtl) {
1161 &:not(:first-child) > box > button.combo { @extend %linked_not_right; }
1162 &:not(:last-child) > box > button.combo { @extend %linked_not_left; }
1163 }
1164 }
1165
1166 .linked.vertical > filechooserbutton > combobox,
1167 .linked.vertical > appchooserbutton > combobox,
1168 .linked.vertical > combobox {
1169 &:not(:first-child) > box > button.combo { @extend %linked_not_top; }
1170 &:not(:last-child) > box > button.combo { @extend %linked_not_bottom; }
1171 }
1172
1173 /************
1174 * Toolbars *
1175 ************/
1176 %toolbar {
1177 padding: 4px;
1178 border-spacing: 1px;
1179 background-color: $bg_color;
1180 }
1181
1182 .toolbar {
1183 @extend %toolbar;
1184
1185 // on OSD
1186 .osd & { background-color: transparent; }
1187
1188 // stand-alone OSD toolbars
1189 &.osd {
1190 padding: 7px;
1191 border: 1px solid transparentize(black, 0.5);
1192 border-radius: 3px;
1193 background-color: transparentize($osd_bg_color, 0.1);
1194
1195 &.left,
1196 &.right,
1197 &.top,
1198 &.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
1199
1200 &.top { border-width: 0 0 1px 0; }
1201 &.bottom { border-width: 1px 0 0 0; }
1202 &.left { border-width: 0 1px 0 0; }
1203 &.right { border-width: 0 0 0 1px; }
1204 }
1205
1206 // toolbar separators
1207 separator { background: none; }
1208 &.horizontal separator { margin: 0 6px; }
1209 &.vertical separator { margin: 6px 0; }
1210 }
1211
1212 //searchbar & location-bar
1213 searchbar > revealer > box {
1214 padding: 6px;
1215 border-spacing: 6px;
1216 @extend %toolbar;
1217
1218 border-width: 0 0 1px;
1219 }
1220
1221 /**************
1222 * GtkInfoBar *
1223 **************/
1224 infobar {
1225 > revealer > box {
1226 padding: 8px;
1227 border-spacing: 12px;
1228 border-style: none;
1229 }
1230
1231 &.info,
1232 &.question,
1233 &.warning,
1234 &.error {
1235 > revealer > box {
1236 background-color: $selected_bg_color;
1237 color: $selected_fg_color;
1238 caret-color: currentColor;
1239
1240 button { @extend %selected_button }
1241
1242 selection {
1243 color: $selected_bg_color;
1244 background-color: $selected_fg_color;
1245 }
1246 }
1247 }
1248 }
1249
1250 //close button for info and searchbar
1251
1252 infobar > revealer > box > button.close,
1253 searchbar > revealer > box > button.close {
1254 @extend %selected_button_flat;
1255 }
1256
1257 //
1258 // Buttons on selected backgrounds
1259 //
1260 %selected_button {
1261
1262 @at-root %selected_button_normal, & {
1263 color: $selected_fg_color;
1264 background-color: transparentize($selected_fg_color, 1);
1265 border-color: transparentize($selected_fg_color, 0.5);
1266 }
1267
1268 @at-root %selected_button_flat,
1269 &.flat {
1270 @include button(undecorated);
1271 color: $selected_fg_color;
1272 background-color: transparentize($selected_fg_color, 1);
1273
1274 @at-root %selected_button_flat_disabled,
1275 &:disabled {
1276 &, label { color: transparentize($selected_fg_color, 0.6); }
1277 }
1278 }
1279 &:hover {
1280 color: $selected_fg_color;
1281 background-color: transparentize($selected_fg_color, 0.8);
1282 border-color: transparentize($selected_fg_color, 0.2);
1283 }
1284 @at-root %selected_button_active,
1285 &:active, &:active:hover, &:checked {
1286 color: $selected_bg_color;
1287 background-color: $selected_fg_color;
1288 border-color: $selected_fg_color;
1289 }
1290 &:disabled {
1291 &, label { color: transparentize($selected_fg_color, 0.5); }
1292 background-color: transparentize($selected_fg_color, 1);
1293 border-color: transparentize($selected_fg_color, 0.6);
1294
1295 @at-root %selected_button_disabled_active,
1296 &:active, &:checked {
1297 color: $selected_bg_color;
1298 background-color: transparentize($selected_fg_color, 0.5);
1299 border-color: transparentize($selected_fg_color, 0.6);
1300 }
1301 }
1302 }
1303
1304
1305 /*****************
1306 * Title buttons *
1307 *****************/
1308
1309 windowcontrols {
1310 border-spacing: 6px;
1311
1312 &:not(.empty) {
1313 &.start:dir(ltr),
1314 &.end:dir(rtl) {
1315 margin-right: 7px;
1316 }
1317
1318 &.start:dir(rtl),
1319 &.end:dir(ltr) {
1320 margin-left: 7px;
1321 }
1322 }
1323
1324 button {
1325 padding: 0;
1326 min-width: 24px;
1327
1328 @include button(undecorated);
1329 background-color: transparentize($header_bg, 1);
1330
1331 &:hover {
1332 @include button(header-hover);
1333 }
1334 &:active, &:checked {
1335 @include button(header-active);
1336 }
1337 &.close, &.maximize, &.minimize {
1338 &, &:hover, &:active, &:checked {
1339 color: transparent;
1340 background-color: transparent;
1341 background-position: center;
1342 background-repeat: no-repeat;
1343 border-width: 0;
1344
1345 &:backdrop { opacity: 1; }
1346 }
1347 }
1348 // Load png assets for each button
1349 @each $k in ('close','maximize', 'minimize') {
1350 @each $l, $m in ('',''), (':backdrop','-backdrop'), (':hover','-hover'), (':active','-active') {
1351
1352 &.#{$k}#{$l} { background-image: -gtk-scaled(url('assets/titlebutton-#{$k}#{$m}#{$darker_asset_suffix}.png'),
1353 url('assets/titlebutton-#{$k}#{$m}#{$darker_asset_suffix}@2.png')); }
1354 }
1355 }
1356 }
1357 }
1358
1359 /***************
1360 * Header bars *
1361 ***************/
1362 %titlebar,
1363 headerbar {
1364 padding: 0 7px;
1365 min-height: 42px;
1366 border-width: 0 0 1px;
1367 border-style: solid;
1368 border-color: opacify($header_border, 1);
1369 border-radius: 0;
1370
1371 color: $header_fg;
1372 background-color: opacify($header_bg, 1);
1373 box-shadow: inset 0 1px lighten($header_bg, 3%);
1374
1375 .csd & { // Transparent header-bars only in csd windows
1376 background-color: $header_bg;
1377 border-color: $header_border;
1378 }
1379
1380 &:backdrop {
1381 color: transparentize($header_fg, 0.3);
1382 background-color: opacify($header_bg_backdrop, 1);
1383 transition: $backdrop_transition;
1384
1385 .csd & { background-color: $header_bg_backdrop; }
1386 }
1387
1388 .title {
1389 padding-left: 12px;
1390 padding-right: 12px;
1391 font-weight: normal;
1392 }
1393
1394 .subtitle {
1395 font-size: smaller;
1396 padding-left: 12px;
1397 padding-right: 12px;
1398
1399 @extend .dim-label;
1400 }
1401
1402 // squared corners when the window is maximized, tiled, or fullscreen
1403 .tiled &,
1404 .tiled-top &,
1405 .tiled-left &,
1406 .tiled-right &,
1407 .tiled-bottom &,
1408 .maximized &,
1409 .fullscreen & {
1410 &:backdrop, & {
1411 border-radius: 0;
1412 }
1413 }
1414
1415 // non-transparent headerbar for maximized windows
1416 .maximized & {
1417 background-color: opacify($header_bg, 1);
1418 border-color: opacify($header_border, 1);
1419
1420 &:backdrop { background-color: opacify($header_bg_backdrop, 1); }
1421 }
1422
1423 &.default-decoration {
1424 min-height: 28px;
1425 padding: 0 3px;
1426 background-color: opacify($header_bg, 1);
1427 border-bottom-width: 0;
1428
1429 .maximized & { background-color: opacify($header_bg, 1); }
1430
1431 windowcontrols {
1432 button,
1433 menubutton {
1434 min-height: 24px;
1435 min-width: 24px;
1436 margin: 0;
1437 padding: 0;
1438 }
1439
1440 menubutton button {
1441 min-height: 20px;
1442 min-width: 20px;
1443 margin: 0;
1444 padding: 2px;
1445 }
1446 }
1447 }
1448
1449 .solid-csd & {
1450 &:backdrop, & {
1451 &:dir(rtl), &:dir(ltr) { // specificity bump
1452 margin: 1px;
1453 background-color: $header_bg;
1454 border-radius: 0;
1455 box-shadow: none;
1456 }
1457 }
1458 }
1459 }
1460
1461 headerbar {
1462 @extend %header_widgets;
1463
1464 > windowhandle > box {
1465 &,
1466 > box.start,
1467 > box.end {
1468 border-spacing: 6px;
1469 }
1470 }
1471
1472 // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
1473 entry,
1474 spinbutton,
1475 separator:not(.sidebar),
1476 button,
1477 menubutton {
1478 margin-top: 6px;
1479 margin-bottom: 6px;
1480 }
1481
1482 // Reset margins for buttons inside menubutton
1483 menubutton > button {
1484 margin-top: 0px;
1485 margin-bottom: 0px;
1486 }
1487
1488 switch {
1489 margin-top: 9px;
1490 margin-bottom: 9px;
1491 }
1492 }
1493
1494
1495 .titlebar:not(headerbar) {
1496 window.csd > & {
1497 // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
1498 padding: 0;
1499 background-color: transparent;
1500 background-image: none;
1501 border-style: none;
1502 border-color: transparent;
1503 box-shadow: none;
1504 }
1505
1506 separator { background-color: opacify($header_border, 1); }
1507
1508 @extend %titlebar;
1509 }
1510
1511 // Fixes stacked transparent headerbars not appearing transparent
1512 .csd headerbar headerbar {
1513 &:backdrop, & {
1514 background-color: transparent;
1515 }
1516 }
1517
1518 // Development versions of apps to use a differently styled headerbar
1519 window.devel {
1520 headerbar.titlebar {
1521 background-image: cross-fade(20% -gtk-icontheme("system-run-symbolic"), image(transparent));
1522 background-position: 90% 2%;
1523 background-size: 256px 256px;
1524 background-repeat: no-repeat;
1525 }
1526 }
1527
1528 %header_separator {
1529 min-width: 1px;
1530 min-height: 1px;
1531 background: none;
1532 border-width: 0 1px;
1533 border-image: linear-gradient(to bottom,
1534 transparentize($header_fg, 1) 25%,
1535 transparentize($header_fg, 0.65) 25%,
1536 transparentize($header_fg, 0.65) 75%,
1537 transparentize($header_fg, 1) 75%) 0 1/0 1px stretch;
1538
1539 &:backdrop { opacity: 0.6; }
1540 }
1541
1542 %header_widgets {
1543 // Headerbar Entries
1544 entry {
1545 @include entry(header-normal);
1546
1547 &:backdrop { opacity: 0.85; }
1548
1549 &:focus {
1550 @include entry(header-focus);
1551 background-clip: if($variant=='light' or $variant=='lighter', border-box, padding-box);
1552
1553 image { color: $selected_fg_color; }
1554 }
1555 &:disabled { @include entry(header-insensitive); }
1556
1557 selection:focus {
1558 background-color: $selected_fg_color;
1559 color: $selected_bg_color;
1560 }
1561
1562 progress {
1563 border-color: $selected_bg_color;
1564 background-image: none;
1565 background-color: transparent;
1566 }
1567
1568 @each $e_type, $e_color, $e_fg_color in (warning, $warning_color, $warning_fg_color),
1569 (error, $error_color, $error_fg_color) {
1570 &.#{$e_type} {
1571 color: $e_fg_color;
1572 border-color: if($variant=='light' or $variant=='lighter', $e_color, $header_entry_border);
1573 background-color: mix($e_color, $header_bg, 60%);
1574
1575 &:focus {
1576 color: $e_fg_color;
1577 background-color: $e_color;
1578 }
1579 selection, selection:focus {
1580 background-color: $e_fg_color;
1581 color: $e_color;
1582 }
1583 }
1584 }
1585 }
1586
1587 // Headerbar Buttons
1588 button {
1589
1590 @include button(header-normal);
1591
1592 &:backdrop { opacity: 0.7; }
1593
1594 &:hover { @include button(header-hover); }
1595 &:active, &:checked {
1596 @include button(header-active);
1597 background-clip: if($variant=='light' or $variant=='lighter', border-box, padding-box);
1598 }
1599 &:disabled { @include button(header-insensitive); }
1600 &:disabled:active, &:disabled:checked { @include button(header-insensitive-active); }
1601 }
1602
1603 .selection-mode & button,
1604 &.selection-mode button {
1605
1606 &, &.flat {
1607 @include button(undecorated);
1608 color: $selection_mode_fg;
1609 background-color: transparentize($selection_mode_fg, 1);
1610 }
1611 &:hover { @extend %selected_button_normal; }
1612 &:active, &:checked { @extend %selected_button_active; }
1613
1614 &:disabled {
1615 @extend %selected_button_flat_disabled;
1616
1617 &:checked, &:active { @extend %selected_button_disabled_active; }
1618 }
1619 }
1620
1621 // Linking stuff
1622
1623 // Disconnect linked buttons
1624 .linked:not(.vertical):not(.path-bar):not(stackswitcher) {
1625 button:not(:last-child):not(:only-child) { margin-right: 1px; }
1626 }
1627
1628 // Reset buttons
1629 .linked:not(.vertical):not(.path-bar) > button {
1630 &, &:hover, &:active, &:checked, &:disabled {
1631 border-radius: 3px;
1632 border-style: solid;
1633 }
1634 }
1635 .linked:not(.vertical):not(.path-bar) {
1636 $_uncolored_button: 'button:not(:checked):not(:active):not(.suggested-action):not(.destructive-action)';
1637
1638 > #{$_uncolored_button}:hover:not(:only-child),
1639 > #{$_uncolored_button}:hover + #{$_uncolored_button},
1640 > #{$_uncolored_button}:disabled:not(:only-child),
1641 > #{$_uncolored_button}:disabled + #{$_uncolored_button}:not(:hover) { box-shadow: none; }
1642 }
1643
1644 // special case for path-bars and stack-switchers
1645 stackswitcher.linked:not(.vertical):not(.path-bar),
1646 .linked:not(.vertical).path-bar {
1647
1648 > button {
1649 @include button(header-hover);
1650
1651 &:hover { background-color: lighten($header_button_bg, 15%); }
1652 &:active, &:checked { @include button(header-active); }
1653 &:disabled { color: transparentize($header_fg, 0.4); }
1654
1655 &, &:hover, &:active, &:checked, &:disabled { @extend %linked; }
1656 }
1657 @include pathbar_linking_rules($sep_color:$header_button_border);
1658 }
1659
1660 // use linking rules for entries only
1661 .linked:not(.vertical):not(.path-bar) {
1662 @include linking_rules( $a:0.5,
1663 $var:if($variant=='light' or $variant=='lighter', 'light', 'dark'),
1664 $button_rules:'false',
1665 $e_border:$header_entry_border,
1666 $b_border:$header_button_border );
1667 }
1668
1669 // Headerbar Suggested and Destructive Action buttons
1670 @each $b_type, $b_color, $b_fg in (suggested-action, $suggested_color, $suggested_fg_color),
1671 (destructive-action, $destructive_color, $destructive_fg_color) {
1672 button.#{$b_type} {
1673 @include button(suggested_destructive, $b_color, $b_fg);
1674
1675 &.flat {
1676 @include button(undecorated);
1677 color: $b_color;
1678 }
1679 &:hover {
1680 @include button(suggested_destructive, lighten($b_color, 10%), $b_fg);
1681 }
1682 &:active, &:checked {
1683 @include button(suggested_destructive, darken($b_color, 10%), $b_fg);
1684 }
1685 &.flat:disabled,
1686 &:disabled { @include button(header-insensitive); }
1687 }
1688 button.#{$b_type}:backdrop,
1689 button.#{$b_type}:backdrop {
1690 opacity: 0.8;
1691 }
1692 }
1693
1694 // Headerbar Spinbuttons
1695 spinbutton:not(.vertical) {
1696 &:focus {
1697 color: $selected_fg_color;
1698 caret-color: $selected_fg_color;
1699 }
1700 button {
1701 &,&:disabled { @include button(header-hover); }
1702
1703 &:hover { background-color: lighten($header_button_bg, 15%); }
1704 &:active, &:checked { @include button(header-active); }
1705 &:disabled { color: transparentize($header_fg, 0.4); }
1706 }
1707
1708 > button + button { border-left-style: none; }
1709
1710 > button:hover:not(:active),
1711 > button:hover + button { box-shadow: inset 1px 0 $header_button_border; }
1712
1713 > button:disabled + button:not(:disabled):not(:active):not(:checked):not(:hover),
1714 > button:not(:disabled):not(:active):not(:checked):not(:hover) + button:disabled { box-shadow: inset 1px 0 $header_button_border; }
1715
1716 > button:first-child:hover:not(:active),
1717 > entry + button:not(:active):hover { box-shadow: none; }
1718
1719 > entry:focus + button { border-left-color: if($variant=='light' or $variant=='lighter', $selected_bg_color, $header_entry_border); }
1720 }
1721
1722 // Headerbar ComboBoxes
1723 combobox {
1724 &:disabled { color: transparentize($header_fg, 0.6); }
1725
1726 > .linked > button.combo {
1727 @include entry(header-normal);
1728
1729 &:hover { @include entry(header-focus); box-shadow: none; }
1730 &:disabled { @include entry(header-insensitive); }
1731 }
1732
1733 > .linked > entry.combo {
1734 &:dir(ltr) {
1735 border-right-style: none;
1736
1737 &:focus { box-shadow: none; }
1738 @if $variant=='light' or $variant=='lighter' { &:focus { box-shadow: 1px 0 $selected_bg_color; } }
1739 }
1740 &:dir(rtl) {
1741 border-left-style: none;
1742
1743 &:focus { box-shadow: none; }
1744 @if $variant=='light' or $variant=='lighter' { &:focus { box-shadow: -1px 0 $selected_bg_color; } }
1745 }
1746 }
1747 > .linked > button.combo {
1748 &:dir(ltr) {
1749 &, &:hover, &:active, &:checked, &:disabled {
1750 border-top-left-radius: 0;
1751 border-bottom-left-radius: 0;
1752 }
1753 }
1754 &:dir(rtl) {
1755 &, &:hover, &:active, &:checked, &:disabled {
1756 border-top-right-radius: 0;
1757 border-bottom-right-radius: 0;
1758 }
1759 }
1760 }
1761 }
1762
1763 // Headerbar Switches
1764 switch {
1765 &:backdrop { opacity: 0.75; }
1766 }
1767
1768 progressbar {
1769 trough { background-color: if($variant=='light', opacify($header_button_border, 0.05), $header_button_border); }
1770
1771 &:backdrop { opacity: 0.75; }
1772 }
1773
1774 // Headerbar Scale
1775 scale {
1776 $_trough_bg: if($variant=='light' or $variant=='lighter', opacify($header_button_border, 0.05), $header_button_border);
1777
1778 &:backdrop { opacity: 0.75; }
1779
1780 slider {
1781 $_slider_border: if($variant=='light' or $variant=='lighter', opacify($header_button_border, 0.2), opacify($header_button_border, 0.3));
1782 $_slider_bg: if($variant=='light' or $variant=='lighter', opacify($header_button_bg,1), lighten(opacify($header_bg,1), 10%));
1783
1784 background-color: $_slider_bg;
1785 border-color: $_slider_border;
1786
1787 &:hover {
1788 background-color: lighten($_slider_bg, 5%);
1789 border-color: $_slider_border;
1790 }
1791 &:active {
1792 background-color: $selected_bg_color;
1793 border-color: $selected_bg_color;
1794 }
1795 &:disabled {
1796 background-color: mix($_slider_bg, $header_bg, 70%);
1797 border-color: $_slider_border;
1798 }
1799 }
1800 trough {
1801 background-color: $_trough_bg;
1802
1803 &:disabled { background-color: if($variant=='light' or $variant=='lighter', transparentize($_trough_bg, 0.05), transparentize($_trough_bg, 0.1)); }
1804 }
1805 }
1806 }
1807
1808
1809 /************
1810 * Pathbars *
1811 ************/
1812
1813 pathbar > button {
1814 &.text-button, &.image-button, & {
1815 padding-left: 6px;
1816 padding-right: 6px;
1817 }
1818
1819 &.text-button.image-button label {
1820 padding-left: 0;
1821 padding-right: 0;
1822 }
1823
1824 &.text-button.image-button, & {
1825 label:last-child { padding-right: 10px; }
1826 label:first-child { padding-left: 10px; }
1827 }
1828
1829 image {
1830 padding-left: 4px;
1831 padding-right: 4px;
1832 }
1833
1834 &.slider-button {
1835 padding-left: 1px;
1836 padding-right: 1px;
1837 }
1838 }
1839
1840 /**************
1841 * Tree Views *
1842 **************/
1843 columnview.view,
1844 treeview.view {
1845 border-left-color: transparentize($fg_color, 0.85); // this is actually the tree lines color,
1846 border-top-color: transparentize(black, 0.9); // while this is the grid lines color, better then nothing
1847
1848 @include focus-ring();
1849
1850 > rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
1851
1852 &:selected {
1853 &:focus, & {
1854 border-radius: 0;
1855 border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
1856 border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunately
1857
1858 @extend %selected_items;
1859 }
1860 }
1861
1862 &:disabled {
1863 color: $insensitive_fg_color;
1864
1865 &:selected {
1866 color: mix($selected_fg_color, $selected_bg_color, 40%);
1867 }
1868 }
1869
1870 &.separator {
1871 min-height: 2px;
1872 color: transparentize(black, 0.9);
1873 }
1874
1875 &:drop(active) {
1876 box-shadow: none;
1877 }
1878
1879 > dndtarget:drop(active) {
1880 border-style: solid none;
1881 border-width: 1px;
1882 border-color: mix($fg_color, $selected_bg_color, 50%);
1883
1884 &.after { border-top-style: none; }
1885
1886 &.before { border-bottom-style: none; }
1887 }
1888
1889 &.expander {
1890 // GtkTreeView uses the larger of the expander’s min-width and min-height
1891 min-width: 16px;
1892 min-height: 16px;
1893 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1894
1895 &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
1896
1897 color: mix($fg_color, $base_color, 50%);
1898
1899 &:hover { color: $fg_color; }
1900
1901 &:selected {
1902 color: mix($selected_fg_color, $selected_bg_color, 70%);
1903
1904 &:hover { color: $selected_fg_color; }
1905 }
1906
1907 &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1908 }
1909
1910 &.progressbar { // progress bar in treeviews
1911 color: $selected_fg_color;
1912 border-radius: 3px;
1913 background-color: $selected_bg_color;
1914 background-image: image($selected_bg_color);
1915 box-shadow: none;
1916
1917 &:selected {
1918 &:focus, & {
1919 color: $selected_bg_color;
1920 box-shadow: none;
1921 background-color: $selected_fg_color;
1922 }
1923 }
1924 }
1925
1926 &.trough { // progress bar trough in treeviews
1927 color: $fg_color;
1928 background-color: $button_border;
1929 border-radius: 3px;
1930 border-width: 0;
1931
1932 &:selected {
1933 &:focus, & {
1934 color: $selected_fg_color;
1935 background-color: transparentize(black, 0.8);
1936 border-radius: 3px;
1937 border-width: 0;
1938 }
1939 }
1940 }
1941
1942 > header {
1943 > button {
1944 $_column_header_color: mix($fg_color,$base_color,80%);
1945
1946 @extend %column_header_button;
1947
1948 color: $_column_header_color;
1949 background-color: $base_color;
1950 font-weight: bold;
1951 text-shadow: none;
1952 box-shadow: none;
1953
1954 &:hover {
1955 @extend %column_header_button;
1956
1957 color: $selected_bg_color;
1958 transition: none; //I shouldn't need this
1959 }
1960
1961 &:active {
1962 @extend %column_header_button;
1963
1964 color: $fg_color;
1965 transition: none; //I shouldn't need this
1966 }
1967 sort-indicator {
1968 &.ascending {
1969 -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
1970 }
1971 &.descending {
1972 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1973 }
1974
1975 min-height: 16px;
1976 min-width: 16px;
1977 }
1978 }
1979 }
1980
1981 button.dnd,
1982 header.button.dnd { // for treeview-like derive widgets
1983 &:active, &:selected, &:hover, & {
1984 padding: 0 6px;
1985 color: $selected_fg_color;
1986 background-image: none;
1987 background-color: $selected_bg_color;
1988 border-style: none;
1989 border-radius: 0;
1990 box-shadow: none;
1991 text-shadow: none;
1992 transition: none;
1993 }
1994 }
1995
1996 acceleditor > label { background-color: $selected_bg_color; } // see tests/testaccel to test
1997 }
1998
1999 %column_header_button {
2000 padding: 0 6px;
2001 background-image: none;
2002 border-style: none solid none none;
2003 border-image: linear-gradient(to bottom,
2004 $base_color 20%,
2005 transparentize(if($variant != 'dark', black, white), 0.89) 20%,
2006 transparentize(if($variant != 'dark', black, white), 0.89) 80%,
2007 $base_color 80%) 0 1 0 0 / 0 1px 0 0 stretch;
2008 border-radius: 0;
2009 text-shadow: none;
2010
2011 &:disabled {
2012 border-color: $bg_color;
2013 background-image: none;
2014 }
2015
2016 &:last-child {
2017 border-right-style: none;
2018 border-image: none;
2019 }
2020 }
2021
2022 /***************
2023 * Popovers *
2024 ***************/
2025 $_popover_bg: if($variant!='dark', $base_color, $bg_color);
2026
2027 popover.background {
2028 background-color: transparent;
2029 font: initial; // Decouple the font of popovers from their entry/textview
2030
2031 > arrow,
2032 > contents {
2033 background-color: $_popover_bg;
2034 background-clip: border-box;
2035 border: 1px solid darken($borders_color, 5%);
2036 box-shadow: 0 2px 6px 1px if($variant!='dark', transparentize(black, 0.93), transparentize(black, 0.65));
2037 }
2038
2039 > contents {
2040 padding: 8px;
2041 border-radius: 3px;
2042
2043 > list,
2044 > .view,
2045 > .toolbar {
2046 border-style: none;
2047 background-color: transparent;
2048 }
2049
2050 separator {
2051 background-color: $_popover_bg;
2052 margin: 2px 0;
2053 }
2054
2055 list separator { margin: 2px 0; }
2056 }
2057
2058 .osd &,
2059 &.touch-selection,
2060 &.magnifier {
2061 background-color: transparent;
2062
2063 > arrow,
2064 > contents {
2065 @extend %osd;
2066 }
2067 }
2068
2069 &.touch-selection,
2070 &.magnifier {
2071 button { @extend %osd_button; }
2072 }
2073 }
2074
2075 magnifier {
2076 background-color: $base_color;
2077 }
2078
2079 /**********************
2080 * Popover Base Menus *
2081 **********************/
2082
2083 $_menu-padding: 8px; //inner menuitem padding
2084 //global $menu-margin for outside menuitems
2085
2086 popover.menu {
2087 padding: 0;
2088
2089 box.inline-buttons {
2090 padding: 0 $_menu-padding;
2091
2092 button.image-button.model {
2093 @include button(normal);
2094
2095 &, &:dir(ltr) { margin-left: 6px; }
2096 &:dir(rtl) { margin-right: 6px; }
2097
2098 &:focus { @include button(hover); }
2099 &:active { @include button(active); }
2100 }
2101 }
2102
2103 box.circular-buttons {
2104 padding: $_menu-padding $_menu-padding 6px;
2105
2106 button.circular.image-button.model {
2107 @extend %list_button;
2108
2109 padding: 11px;
2110
2111 &:focus { @include button(hover); }
2112 &:active { @include button(active); }
2113 }
2114 }
2115
2116 accelerator {
2117 color: gtkalpha(currentColor,0.55);
2118
2119 &:dir(ltr) { margin-left: 22px; }//$_menu-padding;
2120 &:dir(rtl) { margin-right: 22px; }//$_menu-padding;
2121 }
2122
2123 arrow.left,
2124 radio.left,
2125 check.left {
2126 margin-left: -1px;
2127 margin-right: 7px;
2128 }
2129
2130 arrow.right,
2131 radio.right,
2132 check.right {
2133 margin-left: 7px;
2134 margin-right: -1px;
2135 }
2136
2137 scale {
2138 padding: 5px $_menu-padding;
2139 }
2140
2141 modelbutton {
2142 min-height: 16px;
2143 min-width: 40px;
2144 padding: 5px $_menu-padding;
2145 border-radius: 2px;
2146 }
2147
2148 label.title {
2149 font-weight: bold;
2150 padding: 4px ($_menu-padding + 20px); //this will fall apart with font sizing
2151 }
2152 }
2153
2154 // initial styling for popover menu and bar
2155 menubar {
2156 padding: 0;
2157 background-color: opacify($header_bg, 1);
2158 color: $header_fg;
2159
2160 &:backdrop {
2161 color: transparentize($header_fg, 0.3);
2162 }
2163
2164 > item {
2165 min-height: 16px;
2166 padding: 4px $_menu-padding;
2167
2168 &:selected { //Seems like it :selected even with keyboard focus
2169 @extend %selected_items;
2170 }
2171
2172 &:disabled {
2173 color: transparentize($header_fg, 0.6);
2174 border-color: transparent;
2175 }
2176 }
2177
2178 & > item popover.menu modelbutton {
2179 border-radius: 0;
2180 }
2181
2182 & > item popover.menu.background > contents {
2183 padding: 4px 0;
2184 border-radius: 2px;
2185 }
2186
2187 //nested submenus
2188 & > item popover.menu popover.menu {
2189 margin-top: -5px;
2190 }
2191 }
2192
2193 /*************
2194 * Notebooks *
2195 *************/
2196 notebook {
2197 @include focus-ring("> header > tabs > tab:checked", $focus-state: 'focus:focus-visible')
2198
2199 > header {
2200 padding: 2px;
2201 border-color: $borders_color;
2202 border-width: 1px;
2203 background-color: $bg_color;
2204
2205 // ugly hack to hide the borders around the header
2206 margin: -1px;
2207 &.top { margin-bottom: 0; }
2208 &.bottom { margin-top: 0; }
2209 &.left { margin-right: 0; }
2210 &.right { margin-left: 0; }
2211
2212 &.top, &.bottom { padding-left: 0; padding-right: 0; }
2213 &.left, &.right { padding-top: 0; padding-bottom: 0; }
2214
2215 &.top {
2216 padding-bottom: 0;
2217 border-bottom-style: solid;
2218 > tabs {
2219 margin-bottom: -1px;
2220 > tab {
2221 padding: 2px 10px;
2222 min-width: 20px;
2223 min-height: 20px;
2224
2225 border: 1px solid transparent;
2226 border-bottom: none;
2227
2228 // tab overlap
2229 + tab {
2230 margin-left: -1px;
2231 }
2232
2233 border-radius: 1px 1px 0 0;
2234 }
2235 }
2236 }
2237
2238 &.bottom {
2239 padding-top: 0;
2240 border-top-style: solid;
2241 > tabs {
2242 margin-top: -1px;
2243 > tab {
2244 padding: 2px 10px;
2245 min-width: 20px;
2246 min-height: 20px;
2247
2248 border: 1px solid transparent;
2249 border-top: none;
2250
2251 // tab overlap
2252 + tab {
2253 margin-left: -1px;
2254 }
2255
2256 border-radius: 0 0 1px 1px;
2257 }
2258 }
2259 }
2260
2261 &.left {
2262 padding-right: 0;
2263 border-right-style: solid;
2264 > tabs {
2265 margin-right: -1px;
2266 > tab {
2267 padding: 2px 10px;
2268 min-width: 20px;
2269 min-height: 20px;
2270
2271 border: 1px solid transparent;
2272 border-right: none;
2273
2274 // tab overlap
2275 + tab {
2276 margin-top: -1px;
2277 }
2278
2279 border-radius: 1px 0 0 1px;
2280 }
2281 }
2282 }
2283
2284 &.right {
2285 padding-left: 0;
2286 border-left-style: solid;
2287 > tabs {
2288 margin-left: -1px;
2289 > tab {
2290 padding: 2px 10px;
2291 min-width: 20px;
2292 min-height: 20px;
2293
2294 border: 1px solid transparent;
2295 border-left: none;
2296
2297 // tab overlap
2298 + tab {
2299 margin-top: -1px;
2300 }
2301
2302 border-radius: 0 1px 1px 0;
2303 }
2304 }
2305 }
2306
2307 &.top > tabs > arrow {
2308 @extend %notebook_vert_arrows;
2309 }
2310
2311 &.bottom > tabs > arrow {
2312 @extend %notebook_vert_arrows;
2313 }
2314
2315 @at-root %notebook_vert_arrows {
2316 &.down {
2317 -gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
2318 &:first-child { margin-right: 2px; }
2319 }
2320
2321 &.up {
2322 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
2323 &:last-child { margin-left: 2px; }
2324 }
2325 }
2326
2327 &.left > tabs > arrow {
2328 @extend %notebook_horz_arrows;
2329 }
2330
2331 &.right > tabs > arrow {
2332 @extend %notebook_horz_arrows;
2333 }
2334
2335 @at-root %notebook_horz_arrows {
2336 &.down {
2337 -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
2338 &:first-child { margin-bottom: 2px; }
2339 }
2340
2341 &.up {
2342 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
2343 &:last-child { margin-top: 2px; }
2344 }
2345 }
2346
2347 > tabs > arrow {
2348 color: $insensitive_fg_color;
2349
2350 &:hover { color: mix($fg_color, $insensitive_fg_color, 50%); }
2351 &:active { color: $fg_color; }
2352 &:disabled { color: transparentize($insensitive_fg_color,0.3); }
2353 }
2354
2355 &.top > tabs > tab:hover:not(:checked) { box-shadow: inset 0 -1px $borders_color; }
2356 &.bottom > tabs > tab:hover:not(:checked) { box-shadow: inset 0 1px $borders_color; }
2357 &.left > tabs > tab:hover:not(:checked) { box-shadow: inset -1px 0 $borders_color; }
2358 &.right > tabs > tab:hover:not(:checked) { box-shadow: inset 1px 0 $borders_color; }
2359
2360 > tabs > tab {
2361 color: $insensitive_fg_color;
2362 background-color: transparentize($base_color, 1);
2363 font-weight: normal;
2364
2365 &:hover:not(:checked) {
2366 color: mix($fg_color, $insensitive_fg_color, 50%);
2367 background-color: transparentize($base_color, 0.5);
2368 border-color: $borders_color;
2369 }
2370
2371 &:checked {
2372 color: $fg_color;
2373 background-color: $base_color;
2374 border-color: $borders_color;
2375 }
2376
2377 // colors the button like the label, overridden otherwise
2378 button.flat {
2379 color: gtkalpha(currentColor, 0.3);
2380 &:hover { color: currentColor; }
2381
2382 padding: 0;
2383 // FIXME: generalize .small-button?
2384 min-width: 16px;
2385 min-height: 22px;
2386
2387 &:hover {
2388 @extend %undecorated_button;
2389 color: lighten(red, 15%);
2390 }
2391 &:active, &:active:hover {
2392 @extend %undecorated_button;
2393 color: $selected_bg_color;
2394 }
2395 }
2396 }
2397 }
2398
2399 > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
2400 background-color: $base_color;
2401 }
2402 }
2403
2404 /**************
2405 * Scrollbars *
2406 **************/
2407 $scrollbar_bg_color: darken($base_color, 1%);
2408
2409 scrollbar {
2410 $_slider_min_length: 40px;
2411 $_slider_width: 6px;
2412 $_fine-tune_slider_border: $_slider_width - 3;
2413
2414 background-color: $scrollbar_bg_color;
2415
2416 // scrollbar border
2417 &.top { border-bottom: 1px solid $borders_color; }
2418 &.bottom { border-top: 1px solid $borders_color; }
2419 &.left { border-right: 1px solid $borders_color; }
2420 &.right { border-left: 1px solid $borders_color; }
2421
2422 > range > trough > slider {
2423 min-width: $_slider_width;
2424 min-height: $_slider_width;
2425 margin: -1px;
2426 border: 4px solid transparent;
2427 border-radius: 8px;
2428 background-clip: padding-box;
2429 background-color: mix($fg_color, $bg_color, 40%);
2430
2431 &:hover { background-color: mix($fg_color, $bg_color, 30%); }
2432
2433 &:hover:active { background-color: $selected_bg_color; }
2434
2435 &:disabled { background-color: transparent; }
2436 }
2437
2438 > range.fine-tune {
2439 > trough > slider {
2440 transition: none;
2441 min-width: $_fine-tune_slider_border+1;
2442 min-height: $_fine-tune_slider_border+1;
2443 }
2444
2445 &.horizontal > trough > slider { border-width: $_fine-tune_slider_border 4px; }
2446 &.vertical > trough > slider { border-width: 4px $_fine-tune_slider_border; }
2447
2448 }
2449
2450 &.overlay-indicator {
2451 &:not(.dragging):not(.hovering) {
2452 border-color: transparent;
2453 opacity: 0.4;
2454 background-color: transparent;
2455
2456 > range > trough > slider {
2457 margin: 0;
2458 min-width: 4px;
2459 min-height: 4px;
2460 background-color: mix($fg_color, $bg_color, 70%);
2461 border: 1px solid if($variant != 'dark', transparentize(white, 0.4), transparentize(black, 0.7));
2462 }
2463
2464 &.horizontal {
2465 > range > trough > slider {
2466 margin: 0 2px;
2467 min-width: $_slider_min_length;
2468 }
2469 }
2470
2471 &.vertical {
2472 > range > trough > slider {
2473 margin: 2px 0;
2474 min-height: $_slider_min_length;
2475 }
2476 }
2477 }
2478
2479 &.dragging,
2480 &.hovering { opacity: 0.99; }
2481 }
2482
2483 &.horizontal > range > trough > slider { min-width: $_slider_min_length; }
2484 &.vertical > range > trough > slider { min-height: $_slider_min_length; }
2485 }
2486
2487 treeview ~ scrollbar.vertical {
2488 border-top: 1px solid $borders_color;
2489 margin-top: -1px;
2490 }
2491
2492 /**********
2493 * Switch *
2494 **********/
2495 //FIXME port asset images to pure CSS (in GTK3 too)??
2496 switch {
2497 font-size: 1px;
2498
2499 min-width: 52px;
2500 min-height: 24px;
2501
2502 background-size: 52px 24px;
2503 background-repeat: no-repeat;
2504 background-position: center center;
2505
2506 @include focus-ring($outer: true);
2507
2508 > slider {
2509 min-width: 1px;
2510 min-height: 1px;
2511 }
2512
2513 &, & > slider {
2514 border: none;
2515 box-shadow: none;
2516 }
2517
2518 & > image {
2519 outline-color: transparent;
2520 color: transparent;
2521 }
2522 }
2523
2524 @each $k,$l in ('',''),
2525 (':checked','-active'),
2526 (':disabled','-insensitive'),
2527 (':checked:disabled','-active-insensitive') {
2528
2529 // load switch troughs from .png files in assets directory
2530
2531 switch#{$k} {
2532 background-image: -gtk-scaled(url("assets/switch#{$l}#{$asset_suffix}.png"),url("assets/switch#{$l}#{$asset_suffix}@2.png"));
2533 }
2534
2535 modelbutton:hover switch#{$k},
2536 row:selected switch#{$k},
2537 infobar switch#{$k} {
2538 background-image: -gtk-scaled(url("assets/switch#{$l}-selected.png"),url("assets/switch#{$l}[email protected]"));
2539 }
2540
2541 headerbar switch#{$k} {
2542 background-image: -gtk-scaled(url("assets/switch#{$l}-header#{$darker_asset_suffix}.png"),url("assets/switch#{$l}-header#{$darker_asset_suffix}@2.png"));
2543 }
2544 }
2545
2546 /*************************
2547 * Check and Radio items *
2548 *************************/
2549 // draw regular check and radio items using our PNG assets
2550 // all assets are rendered from assets.svg. never add pngs directly
2551
2552 //selection-mode
2553 @each $check_state,$check_asset in ('','-selectionmode'),
2554 (':checked', '-checked-selectionmode') {
2555 .view.content-view.check#{$check_state}:not(list),
2556 .content-view .tile check#{$check_state}:not(list) {
2557 -gtk-icon-shadow: none;
2558 -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$check_asset}#{$asset_suffix}.png"),
2559 url("assets/checkbox#{$check_asset}#{$asset_suffix}@2.png"));
2560 background-color: transparent;
2561 }
2562 }
2563
2564 checkbutton {
2565 border-spacing: 4px;
2566
2567 @include focus-ring();
2568
2569 &.text-button {
2570 // this is for a nice focus on check and radios text
2571 padding: 4px;
2572 }
2573 }
2574
2575 @each $w,$a in ('check', 'checkbox'),
2576 ('radio','radio') {
2577
2578 //standard checks and radios
2579 @each $s,$as in ('','-unchecked'),
2580 (':disabled','-unchecked-insensitive'),
2581 (':indeterminate', '-mixed'),
2582 (':indeterminate:disabled', '-mixed-insensitive'),
2583 (':checked', '-checked'),
2584 (':checked:disabled','-checked-insensitive') {
2585 .#{$w}#{$s},
2586 #{$w}#{$s},
2587 treeview.view #{$w}#{$s} {
2588 -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}#{$asset_suffix}.png"),
2589 url("assets/#{$a}#{$as}#{$asset_suffix}@2.png"));
2590 }
2591
2592 .osd {
2593 #{$w}#{$s} {
2594 -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-dark.png"),
2595 url("assets/#{$a}#{$as}[email protected]"));
2596 }
2597 }
2598 // the borders of checks and radios are
2599 // too similar in luminosity to the selected background color, hence
2600 // we need special casing.
2601 modelbutton #{$w}#{$s}:selected,
2602 .view #{$w}#{$s}:selected,
2603 treeview.#{$w}#{$s}:selected,
2604 row:selected #{$w}#{$s},
2605 infobar #{$w}#{$s} {
2606 -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-selected.png"),
2607 url("assets/#{$a}#{$as}[email protected]"));
2608 }
2609 }
2610 }
2611
2612 /************
2613 * GtkScale *
2614 ************/
2615 %scale_trough {
2616 border: none;
2617 border-radius: 2.5px;
2618 background-color: $scale_trough_bg;
2619
2620 &:disabled {
2621 background-color: transparentize($scale_trough_bg, 0.45);
2622 }
2623
2624 // ...on selected list-rows and infobars
2625 modelbutton:hover &,
2626 row:selected &,
2627 infobar & {
2628 background-color: transparentize(black, 0.8);
2629
2630 &:disabled {
2631 background-color: transparentize(black, 0.9);
2632 }
2633 }
2634
2635 // OSD
2636 .osd & {
2637 background-color: if($variant == 'lighter', $osd_button_border, lighten($osd_bg_color, 7%));
2638
2639 &:disabled { }
2640 }
2641 }
2642
2643 %scale_highlight {
2644 border: none;
2645 border-radius: 2.5px;
2646 background-color: $selected_bg_color;
2647
2648 &:disabled {
2649 background-color: transparentize($selected_bg_color, 0.45);
2650 }
2651
2652 // ...on selected list-rows and infobars
2653 modelbutton:hover &,
2654 row:selected &,
2655 infobar & {
2656 background-color: $selected_fg_color;
2657
2658 &:disabled { background-color: mix($selected_fg_color, $selected_bg_color, 55%); }
2659 }
2660
2661 // OSD
2662 .osd & {
2663 background-color: $selected_bg_color;
2664
2665 &:disabled { }
2666 }
2667 }
2668
2669 scale {
2670 // sizing
2671 $_marks_length: 3px;
2672 $_marks_distance: 1px;
2673
2674 min-height: 15px;
2675 min-width: 15px;
2676 padding: 3px;
2677
2678 @include focus-ring();
2679
2680 // the slider is inside the trough, so to have make it bigger there's a negative margin
2681 > trough {
2682 > slider {
2683 min-height: 15px;
2684 min-width: 15px;
2685 margin: -6px;
2686 }
2687 }
2688
2689 // click-and-hold the slider to activate
2690 &.fine-tune {
2691 // to make the trough grow in fine-tune mode
2692 > trough > slider { margin: -4px; }
2693
2694 > trough > fill,
2695 > trough > highlight,
2696 > trough {
2697 border-radius: 5px;
2698 }
2699 }
2700
2701 // the backing bit
2702 > trough {
2703 @extend %scale_trough;
2704 }
2705
2706 // the colored part of the backing bit
2707 > trough > highlight { @extend %scale_highlight; }
2708
2709 // this is another differently styled part of the backing bit, the most relevant use case is for example
2710 // in media player to indicate how much video stream as been cached
2711 > trough > fill {
2712 @extend %scale_trough;
2713
2714 background-color: transparentize($selected_bg_color, 0.5);
2715
2716 &:disabled {
2717 background-color: transparent;
2718 }
2719 }
2720
2721 > trough > slider {
2722 $_slider_border: if($variant!='dark', transparentize(darken($button_border,25%), 0.5), darken($button_border,2%));
2723
2724 background-color: $button_bg;
2725 border-width: 1px;
2726 border-style: solid;
2727 border-color: $_slider_border;
2728 border-radius: 100%;
2729 transition: $button_transition;
2730 transition-property: background, border;
2731
2732 &:hover { background-color: lighten($button_bg, 5%); }
2733
2734 &:active {
2735 background-clip: border-box;
2736 background-color: $selected_bg_color;
2737 border-color: $selected_bg_color;
2738 }
2739
2740 &:disabled {
2741 background-color: mix($entry_bg, $bg_color, 55%);
2742 border-color: transparentize($_slider_border, 0.2);
2743 }
2744
2745 // ...on selected list rows
2746 modelbutton:hover &,
2747 row:selected &,
2748 infobar & {
2749 background-clip: border-box;
2750 background-color: $selected_fg_color;
2751 border-color: $selected_fg_color;
2752
2753 &:hover {
2754 background-color: mix($selected_fg_color, $selected_bg_color, 85%);
2755 border-color: mix($selected_fg_color, $selected_bg_color, 85%);
2756 }
2757 &:active {
2758 background-color: mix($selected_fg_color, $selected_bg_color, 50%);
2759 border-color: mix($selected_fg_color, $selected_bg_color, 50%);
2760 }
2761 &:disabled{
2762 background-color: mix($selected_fg_color, $selected_bg_color, 55%);
2763 border-color: mix($selected_fg_color, $selected_bg_color, 55%);
2764 }
2765 }
2766
2767 // OSD
2768 .osd & {
2769 background-clip: border-box;
2770 background-color: $selected_bg_color;
2771 border-color: $selected_bg_color;
2772
2773 &:hover {
2774 background-color: lighten($selected_bg_color, 10%);
2775 border-color: lighten($selected_bg_color, 10%)
2776 }
2777
2778 &:active {
2779 background-color: darken($selected_bg_color, 10%);
2780 border-color: darken($selected_bg_color, 10%);
2781 }
2782
2783 &:disabled { }
2784 }
2785 }
2786
2787 > value {
2788 color: gtkalpha(currentColor, 0.4);
2789 font-feature-settings: "tnum";
2790 }
2791
2792 &.horizontal {
2793 > marks {
2794 color: gtkalpha(currentColor, 0.4);
2795 &.top {
2796 margin-bottom: $_marks_distance;
2797 margin-top: -($_marks_distance + $_marks_length);
2798 }
2799 &.bottom {
2800 margin-top: $_marks_distance;
2801 margin-bottom: -($_marks_distance + $_marks_length);
2802 }
2803
2804 indicator {
2805 background-color: currentColor;
2806 min-height: $_marks_length;
2807 min-width: 1px;
2808 }
2809 }
2810
2811 &.fine-tune > marks {
2812 &.top {
2813 margin-bottom: ($_marks_distance - 1px);
2814 margin-top: -($_marks_distance + $_marks_length - 2px);
2815 }
2816 &.bottom {
2817 margin-top: ($_marks_distance - 1px);
2818 margin-bottom: -($_marks_distance + $_marks_length - 2px);
2819 }
2820
2821 indicator { min-height: ($_marks_length - 1px); }
2822 }
2823 }
2824
2825 &.vertical {
2826 > marks {
2827 color: gtkalpha(currentColor, 0.4);
2828 &.top {
2829 margin-right: $_marks_distance;
2830 margin-left: -($_marks_distance + $_marks_length);
2831 }
2832 &.bottom {
2833 margin-left: $_marks_distance;
2834 margin-right: -($_marks_distance + $_marks_length);
2835 }
2836
2837 indicator {
2838 background-color: currentColor;
2839 min-height: 1px;
2840 min-width: $_marks_length;
2841 }
2842 }
2843
2844 &.fine-tune > marks {
2845 &.top {
2846 margin-right: ($_marks_distance - 1px);
2847 margin-left: -($_marks_distance + $_marks_length - 2px);
2848 }
2849 &.bottom {
2850 margin-left: ($_marks_distance - 1px);
2851 margin-right: -($_marks_distance + $_marks_length - 2px);
2852 }
2853
2854 indicator { min-height: ($_marks_length - 1px); }
2855 }
2856 }
2857
2858 // Draw the drop-shaped slider for when scale has marks with CSS
2859 // instead of image assets, by having one corner with zero radius
2860 // and rotating it according to the scale position.
2861 &.marks-before,
2862 &.marks-after {
2863 > trough > slider {
2864 border-top-left-radius: 0;
2865 }
2866 }
2867 &.horizontal.marks-before:not(.marks-after) > trough > slider {
2868 transform: rotate(45deg);
2869 }
2870 &.horizontal.marks-after:not(.marks-before) > trough > slider {
2871 transform: rotate(225deg);
2872 }
2873 &.vertical.marks-before:not(.marks-after) > trough > slider {
2874 transform: rotate(315deg);
2875 }
2876 &.vertical.marks-after:not(.marks-before) > trough > slider {
2877 transform: rotate(135deg);
2878 }
2879
2880 &.color {
2881 min-height: 0;
2882 min-width: 0;
2883
2884 > trough {
2885 background-image: image($scale_trough_bg);
2886 background-repeat: no-repeat;
2887 border: 1px solid $scale_trough_bg;
2888 min-height: 13px;
2889 min-width: 13px;
2890 }
2891
2892 > trough > slider {
2893 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
2894 margin: -8px;
2895 }
2896 }
2897
2898 &.horizontal {
2899 padding: 0 0 15px 0;
2900
2901 > trough {
2902 padding-bottom: 4px;
2903 background-position: 0 -3px;
2904 border-top-left-radius: 0;
2905 border-top-right-radius: 0;
2906 }
2907
2908 > trough > slider {
2909 &:dir(ltr), &:dir(rtl), & { // specificity bump
2910 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
2911 margin-bottom: -14px;
2912 margin-top: 5px;
2913 }
2914 }
2915 }
2916 }
2917
2918 &.vertical {
2919 &:dir(ltr), & {
2920 padding: 0 0 0 15px;
2921
2922 > trough {
2923 padding-left: 4px;
2924 background-position: 3px 0;
2925 border-bottom-right-radius: 0;
2926 border-top-right-radius: 0;
2927 }
2928
2929 > trough > slider {
2930 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
2931 margin-left: -13px;
2932 margin-right: 4px;
2933 }
2934 }
2935 }
2936
2937 &:dir(rtl) {
2938 padding: 0 15px 0 0;
2939
2940 > trough {
2941 padding-right: 4px;
2942 background-position: -3px 0;
2943 border-bottom-left-radius: 0;
2944 border-top-left-radius: 0;
2945 }
2946
2947 > trough > slider {
2948 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
2949 margin-right: -13px;
2950 margin-left: 4px;
2951 }
2952 }
2953 }
2954 }
2955
2956 &.fine-tune {
2957 &.horizontal {
2958 &:dir(ltr), &:dir(rtl), & { // specificity bump
2959 padding: 0 0 13px 0;
2960
2961 > trough {
2962 padding-bottom: 6px;
2963 background-position: 0 -5px;
2964 }
2965
2966 > trough > slider {
2967 margin-bottom: -14px;
2968 margin-top: 5px;
2969 }
2970 }
2971 }
2972
2973 &.vertical {
2974 &:dir(ltr), & {
2975 padding: 0 0 0 13px;
2976
2977 > trough {
2978 padding-left: 6px;
2979 background-position: 5px 0;
2980 }
2981
2982 > trough > slider {
2983 margin-left: -13px;
2984 margin-right: 4px;
2985 }
2986 }
2987
2988 &:dir(rtl) {
2989 padding: 0 13px 0 0;
2990
2991 > trough {
2992 padding-right: 6px;
2993 background-position: -5px 0;
2994 }
2995
2996 > trough > slider {
2997 margin-right: -13px;
2998 margin-left: 4px;
2999 }
3000 }
3001 }
3002 }
3003 }
3004 }
3005
3006 /*****************
3007 * Progress bars *
3008 *****************/
3009 progressbar {
3010 // sizing
3011 &.horizontal {
3012 > trough {
3013 min-width: 150px;
3014 &, > progress { min-height: 6px; }
3015 }
3016 }
3017
3018 &.vertical {
3019 > trough {
3020 min-height: 80px;
3021 &, > progress { min-width: 6px; }
3022 }
3023 }
3024
3025 // FIXME: insensitive state missing and some other state should be set probably
3026 padding: 0;
3027 font-size: smaller;
3028 color: transparentize($fg_color, 0.3);
3029 font-feature-settings: "tnum";
3030
3031 > trough {
3032 @extend %scale_trough;
3033
3034 border-radius: 3px;
3035 }
3036
3037 > trough > progress {
3038 @extend %scale_highlight;
3039
3040 border-radius: 3px;
3041 }
3042
3043 &.osd { // progressbar.osd used for epiphany page loading progress
3044 min-width: 3px;
3045 min-height: 3px;
3046 background-color: transparent;
3047
3048 > trough {
3049 border-style: none;
3050 border-radius: 0;
3051 background-color: transparent;
3052 box-shadow: none;
3053
3054 > progress {
3055 border-style: none;
3056 border-radius: 0;
3057 }
3058 }
3059 }
3060
3061 > trough.empty > progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
3062 }
3063
3064 /*************
3065 * Level Bar *
3066 *************/
3067 levelbar {
3068 &.horizontal {
3069 trough > block {
3070 min-height: 1px;
3071 }
3072
3073 // segmented level bar
3074 &.discrete {
3075 trough > block {
3076 margin: 0 1px;
3077 min-width: 32px;
3078 }
3079 }
3080 }
3081
3082 &.vertical {
3083 trough > block {
3084 min-width: 1px;
3085 }
3086
3087 &.discrete > trough > block {
3088 margin: 1px 0;
3089 min-height: 32px;
3090 }
3091 }
3092
3093 > trough {
3094 border: none;
3095 padding: 3px;
3096 border-radius: 3px;
3097 background-color: if($variant != 'dark', $button_border, darken($bg_color, 5%));
3098 }
3099
3100 // level bar colours
3101 > trough > block {
3102 &:not(.empty) {
3103 border: 1px solid $selected_bg_color;
3104 background-color: $selected_bg_color;
3105 border-radius: 2px;
3106 }
3107 &.low {
3108 border-color: $warning_color;
3109 background-color: $warning_color;
3110 }
3111 &.high {
3112 border-color: $selected_bg_color;
3113 background-color: $selected_bg_color;
3114 }
3115 &.full {
3116 border-color: $success_color;
3117 background-color: $success_color;
3118 }
3119 &.empty {
3120 background-color: if($variant!='dark', transparentize($fg_color,0.8), $base_color);
3121 border-color: if($variant!='dark', transparentize($fg_color,0.8), $base_color);
3122 }
3123 }
3124 }
3125
3126
3127 /****************
3128 * Print dialog *
3129 *****************/
3130 window.dialog.print {
3131 drawing {
3132 color: $fg_color;
3133 background: none;
3134 border: none;
3135 padding: 0;
3136
3137 paper {
3138 background: white;
3139 color: #5c616c;
3140 border: 1px solid $borders_color;
3141 }
3142
3143 }
3144
3145 .dialog-action-box { margin: 12px; }
3146 }
3147
3148
3149 /**********
3150 * Frames *
3151 **********/
3152 frame,
3153 .frame {
3154 border: 1px solid $borders_color;
3155 }
3156
3157 frame {
3158 border-radius: 0;
3159
3160 > label {
3161 margin: 4px;
3162 }
3163 }
3164
3165 actionbar > revealer > box {
3166 padding: 5px;
3167 border-top: 1px solid $borders_color;
3168 background-color: darken($bg_color, 3%);
3169
3170 &, > box.start, > box.end {
3171 border-spacing: 6px;
3172 }
3173 }
3174
3175 scrolledwindow {
3176 // This is used when content is touch-dragged past boundaries.
3177 // draws a box on top of the content, the size changes programmatically.
3178 > overshoot {
3179 &.top {
3180 @include overshoot(top);
3181 }
3182
3183 &.bottom {
3184 @include overshoot(bottom);
3185 }
3186
3187 &.left {
3188 @include overshoot(left);
3189 }
3190
3191 &.right {
3192 @include overshoot(right);
3193 }
3194 }
3195
3196 > junction { // the small square between two scrollbars
3197 // Only color the top-left (or top right in RTL) pixel, to visually connect
3198 // the borders of the two scrollbars.
3199
3200 background: $borders_color,
3201 linear-gradient(to bottom, transparent 1px, $scrollbar_bg_color 1px),
3202 linear-gradient(to right, transparent 1px, $scrollbar_bg_color 1px);
3203
3204 &:dir(rtl) {
3205 background: $borders_color,
3206 linear-gradient(to bottom, transparent 1px, $scrollbar_bg_color 1px),
3207 linear-gradient(to left, transparent 1px, $scrollbar_bg_color 1px);
3208 }
3209 }
3210 }
3211
3212 //vbox and hbox separators
3213 separator {
3214 background: transparentize(black, 0.9);
3215 min-width: 1px;
3216 min-height: 1px;
3217 }
3218
3219
3220 /*********
3221 * Lists *
3222 *********/
3223 listview,
3224 list {
3225 color: $text_color;
3226 background-color: $base_color;
3227 border-color: $borders_color;
3228
3229 > row { padding: 2px; }
3230 > row.expander { padding: 0px; }
3231 > row.expander .row-header { padding: 2px; }
3232
3233 &.horizontal row.separator,
3234 &.separators.horizontal > row:not(.separator) {
3235 border-left: 1px solid transparentize(black, 0.9);
3236 }
3237 &:not(.horizontal) row.separator,
3238 &.separators:not(.horizontal) > row:not(.separator) {
3239 border-bottom: 1px solid transparentize(black, 0.9);
3240 }
3241 }
3242
3243 row {
3244 @include focus-ring();
3245
3246 &.activatable {
3247 &.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
3248
3249 &:hover { background-color: if($variant != 'dark', transparentize(black, 0.95), transparentize(white, 0.97)); }
3250
3251 &:active { color: $fg_color; }
3252
3253 &:selected {
3254 &:active { color: $selected_fg_color; }
3255
3256 &.has-open-popup,
3257 &:hover { background-color: mix(black, $selected_bg_color, 10%); }
3258 }
3259 }
3260
3261 &:selected {
3262 @extend %selected_items;
3263 }
3264 }
3265
3266 columnview {
3267 // move padding to child cells
3268 > listview > row {
3269 padding: 0;
3270
3271 // align horizontal sizing with header buttons
3272 > cell {
3273 padding: 8px 6px;
3274
3275 &:not(:first-child) {
3276 border-left: 1px solid transparent;
3277 }
3278 }
3279 }
3280
3281 // make column separators visible when :show-column-separators is true
3282 &.column-separators > listview > row > cell {
3283 border-left-color: transparentize(black, 0.9);
3284 }
3285
3286 // shrink vertically for .data-table
3287 &.data-table > listview > row > cell {
3288 padding-top: 2px;
3289 padding-bottom: 2px;
3290 }
3291 }
3292
3293 treeexpander {
3294 border-spacing: 4px;
3295 }
3296
3297 /********************************************************
3298 * Data Tables *
3299 * treeview like tables with individual focusable cells *
3300 * https://gitlab.gnome.org/GNOME/gtk/-/issues/2929 *
3301 ********************************************************/
3302
3303 //FIXME need new arc design
3304 //columnview row:not(:selected) cell editablelabel:not(.editing):focus-within {
3305 // outline: 2px solid $focus_border_color;
3306 //}
3307
3308 columnview row:not(:selected) cell editablelabel.editing:focus-within {
3309 outline: 2px solid $selected_bg_color;
3310 }
3311
3312 columnview row:not(:selected) cell editablelabel.editing text selection {
3313 color: $selected_fg_color;
3314 background-color: $selected_bg_color;
3315 }
3316
3317 /*******************************************************
3318 * Rich Lists *
3319 * Large list usually containing lots of widgets *
3320 * https://gitlab.gnome.org/GNOME/gtk/-/issues/3073 *
3321 *******************************************************/
3322
3323
3324 .rich-list { /* rich lists usually containing other widgets than just labels/text */
3325 & > row {
3326 padding: 8px 12px;
3327 min-height: 32px; /* should be tall even when only containing a label */
3328
3329 & > box {
3330 border-spacing: 12px;
3331 }
3332 }
3333 }
3334
3335 /*********************
3336 * App Notifications *
3337 *********************/
3338 .app-notification {
3339 padding: 10px;
3340 color: $dark_sidebar_fg;
3341 background-color: $dark_sidebar_bg;
3342 background-clip: border-box;
3343 border-radius: 0 0 2px 2px;
3344 border-width: 0 1px 1px 1px;
3345 border-style: solid;
3346 border-color: darken($dark_sidebar_bg, 10%);
3347
3348 border { border: none; }
3349
3350 button {
3351 @include button(osd);
3352 &.flat {
3353 @extend %undecorated_button;
3354 border-color: transparentize($selected_bg_color, 1);
3355 &:disabled { @extend %undecorated_button; }
3356 }
3357 &:hover { @include button(osd-hover); }
3358 &:active, &:checked { @include button(osd-active); background-clip: padding-box; }
3359 &:disabled { @include button(osd-insensitive);
3360 }
3361 }
3362 }
3363
3364
3365 /*************
3366 * Expanders *
3367 *************/
3368 expander {
3369 min-width: 16px;
3370 min-height: 16px;
3371 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
3372 &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
3373
3374 &:disabled { color: $insensitive_fg_color; }
3375
3376 &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
3377 }
3378
3379 expander-widget {
3380 @include focus-ring("> box > title");
3381
3382 > box > title {
3383 border-radius: 3px;
3384
3385 &:hover > expander {
3386 color: lighten($fg_color,30%); //only lightens the icon
3387 }
3388 }
3389 }
3390
3391 .navigation-sidebar,
3392 placessidebar,
3393 stackswitcher,
3394 expander-widget {
3395 &:not(decoration):not(window):drop(active):focus,
3396 &:not(decoration):not(window):drop(active) {
3397 box-shadow: none;
3398 }
3399 }
3400
3401
3402 /************
3403 * Calendar *
3404 ***********/
3405 calendar {
3406 color: $fg_color;
3407 border: 1px solid $borders_color;
3408 border-radius: 3px;
3409 padding: 2px;
3410 font-feature-settings: "tnum";
3411
3412 > header {
3413 color: $fg_color;
3414 border: none;
3415
3416 > button {
3417 &, &:hover, &:active, &:disabled {
3418 @extend %undecorated_button;
3419 }
3420
3421 color: transparentize($fg_color,0.55);
3422
3423 &:hover { color: $fg_color; }
3424 &:active { color: $selected_bg_color; }
3425 &:disabled { color: $insensitive_fg_color; }
3426 }
3427 }
3428
3429 > grid {
3430 > label.day-name {
3431 }
3432
3433 > label.week-number {
3434 }
3435
3436 > label.today {
3437 &, &:selected, &:focus {
3438 @extend %selected_items;
3439 }
3440 }
3441
3442 > label:focus {
3443 background-color: transparentize(black, 0.9);
3444 }
3445
3446 > label.day-number {
3447 padding: 4px;
3448 border-radius: 3px;
3449 &:selected{
3450 background-color: transparentize(black, 0.85);
3451 }
3452 }
3453
3454 > label.day-number.other-month {
3455 color: gtkalpha(currentColor, 0.3);
3456 }
3457 }
3458
3459 }
3460
3461
3462 /***********
3463 * Dialogs *
3464 ***********/
3465 window.dialog.message { // Message Dialog styling
3466 .titlebar {
3467 min-height: 20px;
3468 background-image: none;
3469 background-color: $header_bg;
3470 border-bottom: 1px solid darken($header_bg, 7%);
3471 border-top-left-radius: $header_radius;
3472 border-top-right-radius: $header_radius;
3473 }
3474
3475 .dialog-action-area button { padding: 8px; min-height: 0; }
3476
3477 box.dialog-vbox.vertical {
3478 padding-top: 10px;
3479 border-spacing: 10px;
3480 }
3481
3482 & label.title {
3483 font-weight: 800;
3484 font-size: 15pt;
3485 }
3486
3487 &.csd { // rounded bottom border styling for csd version
3488 &.background {
3489 border-bottom-left-radius: 3px;
3490 border-bottom-right-radius: 3px;
3491 border: none;
3492 }
3493
3494 .dialog-action-area { @include linking_rules(); }
3495
3496 .dialog-action-area button {
3497 border-radius: 0;
3498 border-bottom-style: none;
3499 border-right-style: none;
3500
3501 &:first-child{
3502 border-bottom-left-radius: 2px;
3503 border-left-style: none;
3504 }
3505
3506 &:last-child {
3507 border-bottom-right-radius: 2px;
3508 }
3509 }
3510 }
3511 }
3512
3513 filechooser {
3514 .dialog-action-box {
3515 border-top: 1px solid $borders_color;
3516 }
3517
3518 #pathbarbox { border-bottom: 1px solid transparentize($borders_color, 0.5); }
3519 }
3520
3521
3522 filechooserbutton>button>box {
3523 border-spacing: 6px;
3524 }
3525 filechooserbutton:drop(active) {
3526 box-shadow: none;
3527 border-color: transparent;
3528 }
3529
3530
3531 /***********
3532 * Sidebar *
3533 ***********/
3534 .sidebar {
3535 border-style: none;
3536 background-color: lighten($bg_color, 2%);
3537
3538 &:not(separator) {
3539 @at-root %sidebar_left,
3540 &:dir(ltr),
3541 &.left,
3542 &.left:dir(rtl) {
3543 border-right: 1px solid $borders_color;
3544 border-left-style: none;
3545 }
3546
3547 @at-root %sidebar_right,
3548 &:dir(rtl),
3549 &.right {
3550 border-left: 1px solid $borders_color;
3551 border-right-style: none;
3552 }
3553 }
3554
3555 listview.view,
3556 list { background-color: transparent; }
3557
3558 paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }}
3559 }
3560
3561 stacksidebar {
3562 //not a regular list
3563 list.separators:not(.horizontal) > row:not(.separator) {
3564 border-bottom: none;
3565 }
3566 row {
3567 padding: 10px 4px;
3568 @include focus-ring();
3569
3570 > label {
3571 padding-left: 6px;
3572 padding-right: 6px;
3573 }
3574
3575 &.needs-attention > label {
3576 @extend %needs_attention;
3577 background-size: 6px 6px, 0 0;
3578 }
3579 &:hover {
3580 background-color: if($variant != 'dark', transparentize(black, 0.95), transparentize(white, 0.97));
3581 }
3582 &:selected {
3583 background-color: $selected_bg_color;
3584 border-radius: 0;
3585 color: $selected_fg_color;
3586 }
3587 &:selected:hover:dir(ltr), &:selected:hover:dir(rtl) {
3588 background-color: mix(black, $selected_bg_color, 10%);
3589 }
3590 }
3591 }
3592
3593 separator.sidebar {
3594 background-color: $borders_color;
3595
3596 .titlebar & {
3597 background-color: $header_border;
3598 margin: 0;
3599 }
3600 }
3601
3602
3603 /**********************
3604 * Navigation Sidebar *
3605 **********************/
3606
3607 .navigation-sidebar {
3608 padding: 0;
3609
3610 > separator {
3611 margin: 0;
3612 }
3613
3614 > row {
3615 min-height: 36px;
3616 padding: 0 8px;
3617 border-radius: 0;
3618 margin: 0 0 2px;
3619
3620 @include focus-ring($focus-state: 'focus-visible:focus-within');
3621 &:hover {
3622 background-color: if($variant != 'dark', transparentize(black, 0.95), transparentize(white, 0.97));
3623 }
3624
3625 &:selected {
3626 background-color: $selected_bg_color;
3627 color: $selected_fg_color;
3628
3629 &:hover {
3630 background-color: mix(black, $selected_bg_color, 10%);
3631 }
3632 }
3633
3634 &:disabled { color: $insensitive_fg_color; }
3635 }
3636 }
3637
3638
3639 /****************
3640 * File chooser *
3641 ****************/
3642
3643 $_placesidebar_icons_opacity: 0.7;
3644
3645 row image.sidebar-icon { opacity: $_placesidebar_icons_opacity; } // dim the sidebar icons
3646 // see bug #786613 for details
3647 // on this oddity
3648
3649 /* this should be more generic, only using .navigation-sidebar
3650 https://gitlab.gnome.org/GNOME/gtk/-/issues/2929
3651 */
3652
3653 placessidebar {
3654 .navigation-sidebar > row {
3655 // Needs overriding of the `.navigation-sidebar > row` padding
3656 padding: 0;
3657
3658 // Using margins/padding directly in the SidebarRow
3659 // will make the animation of the new bookmark row jump
3660 > revealer { padding: 0 10px; }
3661
3662 image.sidebar-icon {
3663 &:dir(ltr) { padding-right: 8px; }
3664 &:dir(rtl) { padding-left: 8px; }
3665 }
3666
3667 label.sidebar-label {
3668 &:dir(ltr) { padding-right: 2px; }
3669 &:dir(rtl) { padding-left: 2px; }
3670 }
3671
3672 @at-root button.sidebar-button {
3673 @extend %button_basic_flat;
3674 min-height: 22px;
3675 min-width: 22px;
3676 margin-top: 2px;
3677 margin-bottom: 2px;
3678 padding: 0;
3679 border-radius: 100%;
3680 }
3681
3682 &.sidebar-placeholder-row {
3683 padding: 0 8px;
3684 min-height: 2px;
3685 background-image: image($drop_target_color);
3686 background-clip: content-box;
3687 }
3688
3689 &.sidebar-new-bookmark-row { color: $selected_bg_color; }
3690
3691 &:drop(active):not(:disabled) {
3692 color: $drop_target_color;
3693 box-shadow: inset 0 1px $drop_target_color,
3694 inset 0 -1px $drop_target_color;
3695
3696 &:selected {
3697 color: $selected_fg_color;
3698 background-color: $drop_target_color;
3699 }
3700 }
3701 }
3702 }
3703
3704 placesview {
3705 .server-list-button > image {
3706 transition: 200ms $ease-out-quad;
3707 -gtk-icon-transform: rotate(0turn);
3708 }
3709
3710 .server-list-button:checked > image {
3711 transition: 200ms $ease-out-quad;
3712 -gtk-icon-transform: rotate(-0.5turn);
3713 }
3714
3715 row.activatable:hover { }
3716
3717 > actionbar > revealer > box > box{
3718 border-spacing: 6px;
3719 }
3720 }
3721
3722
3723 /*********
3724 * Paned *
3725 *********/
3726 paned {
3727 > separator {
3728 min-width: 1px;
3729 min-height: 1px;
3730 -gtk-icon-source: none; // defeats the ugly default handle decoration
3731 border-style: none; // just to be sure
3732 background-color: transparent;
3733 // workaround, using background instead of a border since the border will get rendered twice (?)
3734 background-image: image($borders_color);
3735 background-size: 1px 1px;
3736
3737 &:selected { background-image: image($selected_bg_color); } // FIXME is this needed?
3738
3739 &.wide {
3740 min-width: 5px;
3741 min-height: 5px;
3742 background-color: $bg_color;
3743 background-image: image($borders_color), image($borders_color);
3744 background-size: 1px 1px, 1px 1px;
3745 }
3746 }
3747
3748 &.horizontal > separator {
3749 background-repeat: repeat-y;
3750
3751 &:dir(ltr) {
3752 margin: 0 -8px 0 0;
3753 padding: 0 8px 0 0;
3754 background-position: left;
3755 }
3756 &:dir(rtl) {
3757 margin: 0 0 0 -8px;
3758 padding: 0 0 0 8px;
3759 background-position: right;
3760 }
3761
3762 &.wide {
3763 margin: 0;
3764 padding: 0;
3765 background-repeat: repeat-y, repeat-y;
3766 background-position: left, right;
3767 }
3768 }
3769
3770 &.vertical > separator {
3771 margin: 0 0 -8px 0;
3772 padding: 0 0 8px 0;
3773 background-repeat: repeat-x;
3774 background-position: top;
3775
3776 &.wide {
3777 margin: 0;
3778 padding: 0;
3779 background-repeat: repeat-x, repeat-x;
3780 background-position: bottom, top;
3781 }
3782 }
3783 }
3784
3785
3786 /**************
3787 * GtkVideo *
3788 **************/
3789
3790 video {
3791 & image.osd {
3792 min-width: 64px;
3793 min-height: 64px;
3794 border-radius: 32px;
3795 }
3796 background: black;
3797 }
3798
3799 /************
3800 * Tooltips *
3801 ************/
3802 tooltip {
3803 &.background {
3804 // background-color needs to be set this way otherwise it gets drawn twice
3805 // see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
3806 background-color: lighten($osd_bg_color, 10%);
3807 background-clip: padding-box;
3808 }
3809
3810 &.background, & {
3811 color: $osd_fg_color;
3812 }
3813
3814 padding: 4px;
3815 border-radius: 2px;
3816
3817 > box {
3818 border-spacing: 6px;
3819 }
3820 }
3821
3822
3823 /*****************
3824 * Color Chooser *
3825 *****************/
3826 colorswatch {
3827 // This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
3828 // is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
3829 // applied to the overlay box.
3830
3831 @include focus-ring();
3832
3833 &:drop(active), & { border-style: none; } // FIXME: implement a proper drop(active) state
3834
3835 $_colorswatch_radius: 2px;
3836
3837 // base color corners rounding
3838 // to avoid the artifacts caused by rounded corner anti-aliasing the base color
3839 // sports a bigger radius.
3840 // nth-child is needed by the custom color strip.
3841
3842 &.top {
3843 border-top-left-radius: $_colorswatch_radius + 0.5px;
3844 border-top-right-radius: $_colorswatch_radius + 0.5px;
3845
3846 > overlay {
3847 border-top-left-radius: $_colorswatch_radius;
3848 border-top-right-radius: $_colorswatch_radius;
3849 }
3850 }
3851
3852 &.bottom {
3853 border-bottom-left-radius: $_colorswatch_radius + 0.5px;
3854 border-bottom-right-radius: $_colorswatch_radius + 0.5px;
3855
3856 > overlay {
3857 border-bottom-left-radius: $_colorswatch_radius;
3858 border-bottom-right-radius: $_colorswatch_radius;
3859 }
3860 }
3861
3862 &.left,
3863 &:first-child:not(.top) {
3864 border-top-left-radius: $_colorswatch_radius + 0.5px;
3865 border-bottom-left-radius: $_colorswatch_radius + 0.5px;
3866
3867 > overlay {
3868 border-top-left-radius: $_colorswatch_radius;
3869 border-bottom-left-radius: $_colorswatch_radius;
3870 }
3871 }
3872
3873 &.right,
3874 &:last-child:not(.bottom) {
3875 border-top-right-radius: $_colorswatch_radius + 0.5px;
3876 border-bottom-right-radius: $_colorswatch_radius + 0.5px;
3877
3878 > overlay {
3879 border-top-right-radius: $_colorswatch_radius;
3880 border-bottom-right-radius: $_colorswatch_radius;
3881 }
3882 }
3883
3884 &.dark {
3885 outline-color: transparentize(white, 0.6);
3886
3887 > overlay {
3888 color: transparentize(white, 0.3);
3889 }
3890
3891 &.activatable:hover > overlay {
3892 border-color: if($variant != 'dark', transparentize(black, 0.5), $borders_color);
3893 }
3894 }
3895
3896 &.light {
3897 outline-color: transparentize(black, 0.6);
3898
3899 > overlay {
3900 color: transparentize(black, 0.3);
3901 }
3902
3903 &.activatable:hover > overlay {
3904 border-color: if($variant != 'dark', transparentize(black, 0.7), $borders_color);
3905 }
3906 }
3907
3908 &:drop(active) {
3909 box-shadow: none;
3910
3911 &.light > overlay {
3912 border-color: $drop_target_color;
3913 }
3914
3915 &.dark > overlay {
3916 border-color: $drop_target_color;
3917 }
3918 }
3919
3920 > overlay {
3921 border: 1px solid if($variant != 'dark', transparentize(black, 0.85), $borders_color);
3922 }
3923
3924 &.activatable:hover > overlay {
3925 background-color: transparentize(white, 0.8);
3926 }
3927
3928 &#add-color-button {
3929 border-radius: $_colorswatch_radius 0 0 $_colorswatch_radius;
3930
3931 &:only-child { border-radius: $_colorswatch_radius; }
3932
3933 > overlay {
3934 @include button(normal);
3935 }
3936
3937 &.activatable:hover > overlay {
3938 @include button(hover);
3939 }
3940 }
3941
3942 &:disabled {
3943 opacity: 0.5;
3944
3945 > overlay {
3946 border-color: transparentize(black, 0.5);
3947 box-shadow: none;
3948 }
3949 }
3950
3951 row:selected & { box-shadow: 0 0 0 2px $selected_fg_color; }
3952
3953 &#editor-color-sample {
3954 border-radius: 3px;
3955
3956 > overlay { border-radius: 3px; }
3957 }
3958 }
3959
3960 plane {
3961 @include focus-ring();
3962 }
3963
3964 // colorscale popup
3965 colorchooser .popover.osd { border-radius: 3px; }
3966
3967 /********
3968 * Misc *
3969 ********/
3970 .content-view {
3971 background-color: $base_color;
3972
3973 &:hover { -gtk-icon-filter: brightness(1.2); }
3974
3975 .tile {
3976 margin: 2px;
3977 background-color: if($variant!='dark', transparent, black);
3978 border-radius: 0;
3979 padding: 0;
3980
3981 &:active, &:selected { background-color: if($variant!='dark', transparent, $selected_bg_color); }
3982 &:disabled { background-color: if($variant!='dark', transparent, $insensitive_bg_color); }
3983 }
3984
3985 > rubberband { @extend rubberband; }
3986
3987 }
3988
3989 .scale-popup {
3990 .osd & { @extend %osd; }
3991
3992 .osd & button.flat { //FIXME: quick hack, redo properly
3993 border-style: none;
3994 border-radius: 3px;
3995 }
3996
3997 button { // +/- buttons on GtkVolumeButton popup
3998 &:hover {
3999 @include button(hover);
4000 }
4001 }
4002 }
4003
4004
4005 /**********************
4006 * Window Decorations *
4007 *********************/
4008
4009 // this needs to be transparent, see bug #722563
4010 $_wm_border: if($variant!='dark', transparentize(black, 0.9), transparentize(black, 0.45));
4011
4012 window {
4013 // lamefun trick to get rounded borders regardless of CSD use
4014 border-width: 0px;
4015
4016 &.csd {
4017 box-shadow: 0 0 0 1px if($variant == 'dark' or $variant == 'darker', darken($header_bg, 7%), $_wm_border),
4018 0 8px 8px 0 if($variant !='dark', opacify($_wm_border, 0.1), transparentize($_wm_border, 0.2));
4019 margin: 0px;
4020 border-radius: $header_radius $header_radius 0 0;
4021 &:backdrop {
4022 // the transparent shadow here is to enforce that the shadow extents don't
4023 // change when we go to backdrop, to prevent jumping windows.
4024 // The biggest shadow should be in the same order then in the active state
4025 // or the jumping will happen during the transition.
4026 box-shadow: 0 0 0 1px if($variant == 'dark' or $variant == 'darker', transparentize(darken($header_bg, 7%), 0.1), $_wm_border),
4027 0 8px 8px 0 transparent,
4028 0 5px 5px 0 if($variant !='dark', opacify($_wm_border, 0.1), transparentize($_wm_border, 0.2));
4029 transition: $backdrop_transition;
4030 }
4031
4032 &.popup {
4033 border-radius: 2px;
4034 box-shadow: 0 3px 6px if($variant != 'dark', $_wm_border, transparentize($_wm_border, 0.1)),
4035 0 0 0 1px if($variant != 'dark', $_wm_border, darken($bg_color, 10%));
4036 }
4037
4038 &.dialog.message {
4039 border-radius: $header_radius $header_radius 2px 2px;
4040 }
4041 }
4042
4043 &.solid-csd {
4044 margin: 1px;
4045 padding: 0;
4046 border: 1px solid $borders_color;
4047 border-radius: 0;
4048 background-color: $header_bg;
4049 box-shadow: none;
4050 }
4051
4052 &.maximized,
4053 &.fullscreen { border-radius: 0; box-shadow: none; }
4054
4055 &.tiled,
4056 &.tiled-top,
4057 &.tiled-left,
4058 &.tiled-right,
4059 &.tiled-bottom {
4060 border-radius: 0;
4061 box-shadow: 0 0 0 1px if($variant == 'dark' or $variant == 'darker', darken($header_bg, 7%), $_wm_border),
4062 0 0 0 20px transparent; //transparent control workaround -- GTK issue #3670
4063
4064 &:backdrop {
4065 box-shadow: 0 0 0 1px if($variant == 'dark' or $variant == 'darker', darken($header_bg, 7%), $_wm_border),
4066 0 0 0 20px transparent; // GTK issue #3670
4067 }
4068 }
4069
4070 &.popup { border-radius: 0; box-shadow: none; }
4071
4072 // server-side decorations as used by mutter
4073 &.ssd { //just doing borders, wm draws actual shadows
4074 border-radius: $header_radius $header_radius 0 0;
4075 box-shadow: 0 0 0 1px if($variant == 'dark' or $variant == 'darker', transparentize(black, 0.35), $_wm_border);
4076
4077 &.maximized { border-radius: 0; }
4078 }
4079
4080 }
4081
4082 tooltip.csd {
4083 border-radius: 2px;
4084 box-shadow: 0 1px 3px 1px if($variant != 'dark', $_wm_border, transparentize($_wm_border, 0.3));
4085 }
4086
4087 // catch all extend :)
4088
4089 %selected_items {
4090 background-color: $selected_bg_color;
4091
4092 @at-root %nobg_selected_items, & {
4093 color: $selected_fg_color;
4094
4095 @at-root %selected_items_disabled,
4096 &:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
4097
4098 }
4099 }
4100
4101 .monospace { font-family: monospace; }
4102
4103
4104 /**********************
4105 * Touch Copy & Paste *
4106 *********************/
4107 //FIXME Needs Arc design
4108 //touch selection handlebars for the Popover.osd above
4109 cursor-handle {
4110 background-color: transparent;
4111 background-image: none;
4112 box-shadow: none;
4113 border-style: none;
4114 min-width: 20px;
4115 min-height: 24px;
4116 padding-left: 20px;
4117 padding-right: 20px;
4118 padding-top: 24px;
4119 padding-bottom: 24px;
4120
4121 @each $s,$as in ('',''),
4122 (':hover','-hover'),
4123 (':active','-active') { //no need for insensitive and backdrop
4124 &.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) {
4125 $_url: 'assets/text-select-start#{$as}#{$asset_suffix}';
4126 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4127 url('#{$_url}@2.png'));
4128 }
4129
4130 &.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) {
4131 $_url: 'assets/text-select-end#{$as}#{$asset_suffix}';
4132 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4133 url('#{$_url}@2.png'));
4134 }
4135
4136 &.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) {
4137 $_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}';
4138 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4139 url('#{$_url}@2.png'));
4140 }
4141 }
4142 }
4143
4144 shortcuts-section {
4145 margin: 20px;
4146 }
4147
4148 .shortcuts-search-results {
4149 margin: 20px;
4150 border-spacing: 24px;
4151 }
4152
4153 // shortcut window keys
4154 shortcut {
4155 border-spacing: 6px;
4156 }
4157
4158 shortcut > .keycap {
4159 min-width: 20px;
4160 min-height: 25px;
4161 margin-top: 2px;
4162 padding-bottom: 3px;
4163 padding-left: 6px;
4164 padding-right: 6px;
4165
4166 color: $fg_color;
4167 background-color: $base_color;
4168 border: 1px solid;
4169 border-color: if($variant == 'light', mix($borders_color, $bg_color, 50%), $borders_color);
4170 border-radius: 5px;
4171 box-shadow: if($variant == 'light', inset 0 -3px mix($base_color, $bg_color, 20%), inset 0 -3px mix($borders_color, $base_color, 60%));
4172 font-size: smaller;
4173
4174 }
4175
4176 :not(decoration):not(window):drop(active):focus,
4177 :not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
4178 border-color: $drop_target_color;
4179 box-shadow: inset 0 0 0 1px $drop_target_color;
4180 caret-color: $drop_target_color;
4181 }
4182
4183 stackswitcher > button.text-button { min-width: 80px; } // FIXME aggregate with buttons
4184
4185 stackswitcher.circular {
4186 border-spacing: 12px;
4187
4188 // FIXME aggregate with buttons
4189 > button.circular,
4190 > button.text-button.circular {
4191 min-width: 0;
4192 min-height: 0;
4193 padding: 0;
4194 }
4195 }
4196 /*************
4197 * App Icons *
4198 *************/
4199 /* Outline for low res icons */
4200 .lowres-icon {
4201 -gtk-icon-shadow: none;
4202 }
4203
4204 /* Drapshadow for large icons */
4205 .icon-dropshadow {
4206 -gtk-icon-shadow: none;
4207 }
4208
4209 /*********
4210 * Emoji *
4211 ********/
4212
4213 popover.emoji-picker > contents {
4214 padding: 0;
4215 }
4216
4217 .emoji-searchbar {
4218 padding: 5px;
4219 border-spacing: 6px;
4220 border-bottom: 1px solid $borders_color;
4221 }
4222
4223 .emoji-toolbar {
4224 padding: 5px;
4225 border-spacing: 6px;
4226 border-top: 1px solid $borders_color;
4227 }
4228
4229 button.emoji-section {
4230 &:active, &:checked { border-color: transparent; }
4231 }
4232
4233 popover.emoji-picker emoji {
4234 font-size: x-large;
4235 padding: 5px;
4236 border-radius: 2px;
4237
4238 &:focus,
4239 &:hover {
4240 background: $selected_bg_color;
4241 }
4242 }
4243
4244 emoji-completion-row > box {
4245 border-spacing: 8px;
4246 padding: 2px 8px;
4247 }
4248
4249 emoji-completion-row:focus,
4250 emoji-completion-row:hover {
4251 background-color: $selected_bg_color;
4252 color: $selected_fg_color;
4253 }
4254
4255 emoji-completion-row emoji:focus,
4256 emoji-completion-row emoji:hover {
4257 background-color: $selected_bg_color;
4258 color: $selected_fg_color;
4259 }
4260
4261 popover.entry-completion > contents {
4262 padding: 0;
4263 }
4264
4265 statusbar {
4266 padding: 5px 8px 5px 8px;
4267 }
4268
4269 menubutton {
4270 > button > box {
4271 border-spacing: 6px;
4272 }
4273
4274 arrow {
4275 min-height: 16px;
4276 min-width: 16px;
4277 &.none {
4278 -gtk-icon-source: -gtk-icontheme('open-menu-symbolic');
4279 }
4280 &.down {
4281 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
4282 }
4283 &.up {
4284 -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
4285 }
4286 &.left {
4287 -gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
4288 }
4289 &.right {
4290 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
4291 }
4292 }
4293 }
4294