Debian Codegraph @

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