A fork of the Materia GTK theme.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 _common.scss

View raw Download
text/plain • 74.15 kiB
ASCII text
        
            
1
$asset_suffix: if($variant=='dark', '-dark', '');
2
$extra_background_clip: if($variant == 'light', padding-box, border-box);
3
4
$small_size: 24px;
5
$medium_size: 36px;
6
$large_size: 48px;
7
$bar_size: 4px;
8
$menuitem_size: 28px;
9
10
$container_padding: 6px;
11
$material_radius: 2px;
12
$material_faster: 0.2s;
13
$material_slower: 0.3s;
14
$material_ease: cubic-bezier(0.4, 0.0, 0.2, 1);
15
$material_ease_out: cubic-bezier(0.0, 0.0, 0.2, 1);
16
$material_ease_in: cubic-bezier(0.4, 0.0, 1, 1);
17
// FIXME: color's transition is too slow
18
$material_transition: all $material_slower $material_ease_out, color 0;
19
$shadow_transition: box-shadow $material_faster $material_ease_out;
20
21
* {
22
padding: 0;
23
background-clip: padding-box;
24
25
-GtkToolButton-icon-spacing: 4;
26
-GtkTextView-error-underline-color: $error_color;
27
28
// The size for scrollbars. The slider is 2px smaller, but we keep it
29
// up so that the whole area is sensitive to button presses for the
30
// slider. The stepper button is larger in both directions, the slider
31
// only in the width
32
33
-GtkScrolledWindow-scrollbar-spacing: 0;
34
35
-GtkToolItemGroup-expander-size: 11;
36
-GtkTreeView-expander-size: 11;
37
38
-GtkTreeView-horizontal-separator: 4;
39
40
-GtkWidget-text-handle-width: 24;
41
-GtkWidget-text-handle-height: 24;
42
43
-GtkDialog-button-spacing: 4;
44
-GtkDialog-action-area-border: 0;
45
46
// We use the outline properties to signal the focus properties
47
// to the adwaita engine: using real CSS properties is faster,
48
// and we don't use any outlines for now.
49
50
outline-style: solid;
51
outline-width: 2px;
52
outline-color: $track_color;
53
outline-offset: -4px;
54
-gtk-outline-radius: 2px;
55
56
-gtk-secondary-caret-color: $selected_bg_color;
57
}
58
59
60
/***************
61
* Base States *
62
***************/
63
.background {
64
background-color: $bg_color;
65
color: $fg_color;
66
}
67
68
/*
69
These wildcard seems unavoidable, need to investigate.
70
Wildcards are bad and troublesome, use them with care,
71
or better, just don't.
72
Everytime a wildcard is used a kitten dies, painfully.
73
*/
74
75
*:disabled { -gtk-icon-effect: dim; }
76
77
.gtkstyle-fallback {
78
background-color: $bg_color;
79
color: $fg_color;
80
81
&:hover {
82
background-color: darken($bg_color, 5%);
83
color: $fg_color;
84
}
85
86
&:active {
87
background-color: darken($bg_color, 10%);
88
color: $fg_color;
89
}
90
91
&:disabled {
92
background-color: $bg_color;
93
color: $insensitive_fg_color;
94
}
95
96
&:selected {
97
background-color: $selected_bg_color;
98
color: $selected_fg_color;
99
}
100
}
101
102
.view,
103
%view {
104
@extend row.activatable;
105
106
background-color: $base_color;
107
color: $fg_color;
108
109
&:hover, &:active, &:selected { border-radius: 2px; }
110
111
&:disabled {
112
// background-color: $secondary_base_color;
113
color: $insensitive_fg_color;
114
}
115
116
&:selected { @extend %selected_items; }
117
}
118
119
.view,
120
textview {
121
text {
122
// @extend %view;
123
124
background-color: $base_color;
125
color: $fg_color;
126
127
&:disabled {
128
// background-color: $secondary_base_color;
129
color: $insensitive_fg_color;
130
}
131
132
selection { @extend %selected_items; }
133
}
134
}
135
136
textview border {
137
background-color: $secondary_base_color;
138
background-image: image($borders_color); // HACK: the border node just draws background so, using a background-image to draw the border
139
background-repeat: no-repeat;
140
color: $tertiary_fg_color;
141
142
&.bottom {
143
background-size: 100% 1px;
144
background-position: top;
145
}
146
147
&.top {
148
background-size: 100% 1px;
149
background-position: bottom;
150
}
151
152
&.left {
153
background-size: 1px 100%;
154
background-position: right;
155
}
156
157
&.right {
158
background-size: 1px 100%;
159
background-position: left;
160
}
161
}
162
163
iconview { @extend .view; }
164
165
.rubberband,
166
rubberband {
167
border: 1px solid $secondary_selected_bg_color;
168
background-color: scale-alpha($secondary_selected_bg_color, $lower_opacity);
169
}
170
171
flowbox {
172
rubberband { @extend rubberband; }
173
174
flowboxchild {
175
outline-offset: -2px;
176
padding: 4px;
177
border-radius: 2px;
178
179
&:selected { @extend %selected_items; }
180
}
181
}
182
183
label {
184
&.separator {
185
@extend .dim-label;
186
187
color: $fg_color;
188
}
189
190
row:selected &,
191
&:selected { @extend %nobg_selected_items; }
192
193
selection {
194
background-color: $selected_bg_color;
195
color: $selected_fg_color;
196
}
197
198
&:disabled {
199
color: $insensitive_fg_color;
200
201
selection { @extend %selected_items:disabled; }
202
}
203
}
204
205
.dim-label { opacity: $hint_opacity; }
206
207
assistant {
208
.sidebar {
209
padding: 4px 0;
210
// background-color: $base_color;
211
// border-top: 1px solid $borders_color;
212
}
213
214
// &.csd .sidebar { border-top-style: none; }
215
216
.sidebar label {
217
min-height: $medium_size;
218
padding: 0 12px;
219
color: $tertiary_fg_color;
220
font-weight: 500;
221
222
&.highlight { color: $fg_color; }
223
}
224
}
225
226
%osd, .osd { opacity: $higher_opacity; }
227
228
229
/*********************
230
* Spinner Animation *
231
*********************/
232
@keyframes spin {
233
to { -gtk-icon-transform: rotate(1turn); }
234
}
235
236
@keyframes spin_colors {
237
1% { color: $info_bg_color; } 25% { color: $info_bg_color; }
238
26% { color: $question_bg_color; } 50% { color: $question_bg_color; }
239
51% { color: $warning_bg_color; } 75% { color: $warning_bg_color; }
240
76% { color: $error_bg_color; } 100% { color: $error_bg_color; }
241
}
242
243
spinner {
244
background: none;
245
opacity: 0; // non spinning spinner makes no sense
246
-gtk-icon-source: -gtk-icontheme('process-working-symbolic');
247
248
&:checked {
249
opacity: 1;
250
animation: spin 1s linear infinite, spin_colors 4s linear infinite;
251
252
&:disabled { opacity: $disabled_opacity; }
253
}
254
}
255
256
257
/****************
258
* Text Entries *
259
****************/
260
%entry,
261
entry {
262
%entry_basic, & {
263
min-height: $medium_size;
264
padding: 0 8px;
265
border-radius: 2px;
266
267
@include entry(normal);
268
269
&:focus { @include entry(focus); }
270
271
&:disabled { @include entry(insensitive); }
272
273
&.flat {
274
border-radius: 0;
275
276
@include entry(flat-normal);
277
278
&:focus { @include entry(flat-focus); }
279
280
&:disabled { @include entry(flat-insensitive); }
281
}
282
283
image { // icons inside the entry
284
color: gtkalpha(currentColor, $enabled_opacity);
285
286
&:hover, &:active { color: currentColor; }
287
288
&:disabled { color: gtkalpha(currentColor, $hint_opacity); }
289
290
&.left { padding-left: 2px; padding-right: 6px; }
291
292
&.right { padding-left: 6px; padding-right: 2px; }
293
}
294
295
undershoot {
296
&.left { @include undershoot(left); }
297
298
&.right { @include undershoot(right); }
299
}
300
301
selection { @extend %selected_items; }
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
@include entry(normal, $e_color);
308
309
&:focus { @include entry(focus, $e_color); }
310
311
&:disabled { @include entry(insensitive, $e_color); }
312
313
&.flat {
314
@include entry(flat-normal, $e_color);
315
316
&:focus { @include entry(flat-focus, $e_color); }
317
318
&:disabled { @include entry(flat-insensitive, $e_color); }
319
}
320
}
321
}
322
323
&:drop(active) {
324
// box-shadow: inset 0 0 0 2px $accent_bg_color;
325
}
326
327
.osd & {
328
}
329
}
330
331
progress {
332
margin: 2px -6px;
333
border-style: none none solid;
334
border-width: 2px;
335
border-color: $selected_bg_color;
336
// border-radius: 0;
337
// box-shadow: none;
338
background-color: transparent;
339
// background-image: none;
340
}
341
342
// linked entries
343
.linked:not(.vertical) > &:not(.flat) { @extend %linked; }
344
345
// Vertically linked entries
346
.linked.vertical > &:not(.flat) { @extend %linked_vertical; }
347
}
348
349
treeview acceleditor > label { background-color: $selected_bg_color; }
350
351
treeview entry {
352
&.flat, & {
353
min-height: 0;
354
padding: 2px;
355
border-radius: 0;
356
background-color: $base_color;
357
358
&, &:focus {
359
border-image: none;
360
box-shadow: none;
361
}
362
}
363
}
364
365
366
/***********
367
* Buttons *
368
***********/
369
// stuff for .needs-attention
370
@keyframes needs_attention {
371
from {
372
background-image: -gtk-gradient(radial,
373
center center, 0,
374
center center, 0.001,
375
to($accent_bg_color),
376
to(transparent));
377
}
378
379
to {
380
background-image: -gtk-gradient(radial,
381
center center, 0,
382
center center, 0.5,
383
to($accent_bg_color),
384
to(transparent));
385
}
386
}
387
388
%button,
389
button {
390
@at-root %button_basic, & {
391
min-height: 24px;
392
min-width: 16px;
393
padding: 6px 10px;
394
border-radius: 2px;
395
font-weight: 500;
396
397
@include button(normal);
398
399
&:hover { @include button(hover); }
400
401
&:active { @include button(active); }
402
403
&:disabled { @include button(insensitive); }
404
405
&:checked { @include button(checked); }
406
407
&:checked:disabled { @include button(checked-insensitive); }
408
409
&.flat {
410
@include button(flat-normal);
411
412
&:hover { @include button(flat-hover); }
413
414
&:active { @include button(flat-active); }
415
416
&:disabled { @include button(flat-insensitive); }
417
418
&:checked { @include button(flat-checked); }
419
420
&:checked:disabled { @include button(flat-checked-insensitive); }
421
}
422
423
&.image-button {
424
min-width: 24px;
425
padding: 6px;
426
-gtk-outline-radius: 100px;
427
border-radius: 100px;
428
}
429
430
&.text-button {
431
padding-left: 16px;
432
padding-right: 16px;
433
}
434
435
&.text-button.image-button {
436
padding-left: 10px;
437
padding-right: 10px;
438
-gtk-outline-radius: 2px;
439
border-radius: 2px;
440
441
label {
442
&:last-child { padding-left: 2px; padding-right: 6px; }
443
&:first-child { padding-left: 6px; padding-right: 2px; }
444
}
445
}
446
447
.linked > & { @extend %linked; }
448
449
.linked.vertical > & { @extend %linked_vertical; }
450
451
.linked > &.flat,
452
.linked.vertical > &.flat {
453
border-radius: 2px;
454
455
&.image-button {
456
-gtk-outline-radius: 100px;
457
border-radius: 100px;
458
}
459
460
&.text-button.image-button {
461
-gtk-outline-radius: 2px;
462
border-radius: 2px;
463
}
464
}
465
466
&:drop(active) {
467
// box-shadow: inset 0 0 0 2px $accent_bg_color;
468
}
469
}
470
471
@at-root %button_selected, row:selected & {
472
&:disabled { color: $insensitive_secondary_selected_fg_color; }
473
474
&.flat {
475
color: $secondary_selected_fg_color;
476
477
&:hover, &:active { color: $selected_fg_color; }
478
479
&:disabled { color: $insensitive_secondary_selected_fg_color; }
480
}
481
}
482
483
separator {
484
min-width: 0;
485
min-height: 0;
486
background: transparent;
487
}
488
489
// big standalone buttons like in Documents pager
490
&.osd {
491
padding: 12px 16px;
492
493
&.image-button { padding: 12px; }
494
495
&:disabled { opacity: 0; }
496
}
497
498
//overlay / OSD style
499
@at-root %osd_button,
500
.osd & {
501
}
502
503
// Suggested and Destructive Action buttons
504
@each $b_type, $b_color in (suggested-action, $suggested_color),
505
(destructive-action, $destructive_color) {
506
&.#{$b_type} {
507
background-color: $b_color;
508
color: $selected_fg_color;
509
510
// @include button(normal, $b_color, white);
511
512
// &:hover { @include button(hover, $b_color, white); }
513
514
// &:active, &:checked { @include button(active, $b_color, white); }
515
516
&:disabled { @include button(insensitive, $b_color, white); }
517
518
&:checked { background-color: mix($selected_fg_color, $b_color, percentage($lower_opacity)); }
519
520
&.flat {
521
background-color: transparent;
522
color: $b_color;
523
524
// @include button(flat-normal, $b_color, white);
525
526
// &:hover { @include button(flat-hover, $b_color, white); }
527
528
// &:active, &:checked { @include button(flat-active, $b_color, white); }
529
530
&:disabled { @include button(flat-insensitive, $b_color, white); }
531
}
532
533
.osd & {
534
}
535
}
536
}
537
538
.stack-switcher > & {
539
// to position the needs attention dot, padding is added to the button
540
// child, a label needs just lateral padding while an icon needs vertical
541
// padding added too.
542
543
outline-offset: -4px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
544
545
> label {
546
padding-left: 6px; // label padding
547
padding-right: 6px; //
548
}
549
550
> image {
551
padding-left: 6px; // image padding
552
padding-right: 6px; //
553
padding-top: 3px; //
554
padding-bottom: 3px; //
555
}
556
557
&.text-button {
558
// compensate text-button paddings
559
padding-left: 10px;
560
padding-right: 10px;
561
}
562
563
&.image-button {
564
// we want image buttons to have a 1:1 aspect ratio, so compensation
565
// of the padding added to the GtkImage is needed
566
padding-left: 4px;
567
padding-right: 4px;
568
}
569
570
&.needs-attention {
571
> label,
572
> image { @extend %needs_attention; }
573
574
&:checked {
575
> label,
576
> image {
577
animation: none;
578
background-image: none;
579
}
580
}
581
}
582
}
583
584
// inline-toolbar buttons
585
.inline-toolbar & {
586
@extend %button_basic.flat;
587
588
&:not(.text-button) { @extend %button_basic.image-button; }
589
}
590
591
.primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
592
}
593
594
%needs_attention {
595
animation: needs_attention $material_slower $material_ease_out forwards;
596
background-repeat: no-repeat;
597
background-position: right 3px;
598
background-size: 6px 6px;
599
600
&:dir(rtl) { background-position: left 3px; }
601
}
602
603
// all the following is for the +|- buttons on inline toolbars, that way
604
// should really be deprecated...
605
.inline-toolbar toolbutton > button { // redefining the button look is
606
// needed since those are flat...
607
}
608
609
// More inline toolbar buttons
610
toolbar.inline-toolbar toolbutton {
611
// > button.flat { @extend %linked_middle; }
612
613
// &:first-child > button.flat { @extend %linked:first-child; }
614
615
// &:last-child > button.flat { @extend %linked:last-child; }
616
617
// &:only-child > button.flat { @extend %linked:only-child; }
618
}
619
620
%linked_middle {
621
border-radius: 0;
622
}
623
624
%linked {
625
-gtk-outline-radius: 2px;
626
627
@extend %linked_middle;
628
629
&:first-child {
630
border-top-left-radius: 2px;
631
border-bottom-left-radius: 2px;
632
}
633
634
&:last-child {
635
border-top-right-radius: 2px;
636
border-bottom-right-radius: 2px;
637
}
638
639
&:only-child {
640
border-radius: 2px;
641
}
642
}
643
644
%linked_vertical_middle {
645
border-radius: 0;
646
}
647
648
%linked_vertical{
649
-gtk-outline-radius: 2px;
650
651
@extend %linked_vertical_middle;
652
653
&:first-child {
654
border-top-left-radius: 2px;
655
border-top-right-radius: 2px;
656
}
657
658
&:last-child {
659
border-bottom-left-radius: 2px;
660
border-bottom-right-radius: 2px;
661
}
662
663
&:only-child {
664
border-radius: 2px;
665
}
666
}
667
668
/* menu buttons */
669
modelbutton.flat,
670
.menuitem.button.flat {
671
min-height: $menuitem_size;
672
padding-left: 8px;
673
padding-right: 8px;
674
border-radius: 2px;
675
color: inherit;
676
677
@extend %button_basic.flat;
678
679
&:selected { @extend %selected_items; }
680
681
check,
682
radio {
683
&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $hint_opacity); }
684
685
&, &:hover { background-image: none; }
686
687
&:active { animation: none; }
688
689
&:last-child { margin-left: -8px; margin-right: -16px; }
690
691
&:first-child { margin-left: -16px; margin-right: -8px; }
692
}
693
694
check:not(:indeterminate):checked { @extend %check_checked; }
695
696
// radio:not(:indeterminate):checked { @extend %radio_checked; }
697
698
check:indeterminate:checked, radio:indeterminate:checked { @extend %indeterminate_checked; }
699
}
700
701
modelbutton.flat arrow {
702
background: none;
703
704
&:hover { background: none; }
705
706
&.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
707
708
&.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
709
}
710
711
button.color {
712
min-height: $small_size;
713
min-width: $small_size;
714
padding: $container_padding;
715
716
colorswatch:only-child {
717
// &, overlay { border-radius: 0; }
718
}
719
}
720
721
722
/*********
723
* Links *
724
*********/
725
*:link {
726
&, &:hover, &:active { color: $link_color; }
727
728
&:visited {
729
&, &:hover, &:active { color: $link_visited_color; }
730
}
731
732
@at-root %link_selected,
733
&:selected,
734
*:selected & { color: $selected_fg_color; }
735
}
736
737
button:link,
738
button:visited {
739
@extend *:link;
740
741
> label { text-decoration-line: underline; }
742
}
743
744
/*****************
745
* GtkSpinButton *
746
*****************/
747
spinbutton {
748
&:not(.vertical) {
749
// in this horizontal configuration, the whole spinbutton
750
// behaves as the entry, so we extend the entry styling
751
// and nuke the style on the internal entry
752
@extend %entry;
753
754
padding: 0;
755
756
%spinbutton_entry,
757
entry {
758
min-width: $large_size - 16px;
759
// reset all the other props since the spinbutton node is styled here
760
margin: 0;
761
border-image: none;
762
border-radius: 0;
763
box-shadow: none;
764
background-color: transparent;
765
}
766
767
button {
768
min-height: $small_size;
769
min-width: $small_size;
770
// margin: $container_padding;
771
padding: 0;
772
border: solid $container_padding transparent;
773
774
@extend %button_basic.flat;
775
776
@extend %button_basic.image-button;
777
778
&.up { margin-left: -$container_padding / 2; }
779
780
&.down { margin-right: -$container_padding / 2; }
781
}
782
}
783
784
// OSD horizontal
785
.osd &:not(.vertical) {
786
button {
787
}
788
}
789
790
// Vertical
791
&.vertical {
792
// in the vertical configuration, we treat the spinbutton
793
// as a box, and tweak the style of the entry in the middle
794
// so that it's linked
795
796
// FIXME: this should not be set at all, but otherwise it gets the wrong
797
// color
798
&:disabled { color: $insensitive_fg_color; }
799
800
&:drop(active) {
801
box-shadow: none;
802
}
803
804
entry {
805
min-height: $medium_size;
806
min-width: $large_size;
807
padding: 0;
808
}
809
810
button {
811
min-height: $medium_size;
812
min-width: $large_size;
813
padding: 0;
814
815
@extend %button_basic.flat;
816
817
&.up { border-radius: 2px 2px 0 0; }
818
819
&.down { border-radius: 0 0 2px 2px; }
820
}
821
}
822
823
// OSD vertical
824
.osd &.vertical button:first-child {
825
}
826
827
// Misc
828
treeview &:not(.vertical) {
829
min-height: 0;
830
border-style: none;
831
border-radius: 0;
832
833
entry {
834
min-height: 0;
835
padding: 1px 2px;
836
}
837
}
838
}
839
840
841
/**************
842
* ComboBoxes *
843
**************/
844
combobox {
845
arrow {
846
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
847
min-height: 16px;
848
min-width: 16px;
849
}
850
851
menu,
852
.menu {
853
padding: 2px 0;
854
855
menuitem {
856
min-height: $medium_size;
857
padding: 0 10px;
858
}
859
}
860
861
&.linked {
862
button:nth-child(2) {
863
&:dir(ltr) { @extend %linked:last-child; }
864
&:dir(rtl) { @extend %linked:first-child; }
865
}
866
}
867
868
&:drop(active) { // FIXME: untested
869
box-shadow: none;
870
871
// button.combo { @extend %button_basic:drop(active); }
872
}
873
}
874
875
.linked > combobox > box > button.combo {
876
// the combo is a composite widget so the way we do button linking doesn't
877
// work, special case needed. See
878
// https://bugzilla.gnome.org/show_bug.cgi?id=733979
879
880
&:dir(ltr),
881
&:dir(rtl) { @extend %linked_middle; } // specificity bump
882
}
883
884
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
885
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
886
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
887
888
.linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
889
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
890
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
891
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
892
893
894
/************
895
* Toolbars *
896
************/
897
toolbar {
898
-GtkWidget-window-dragging: true;
899
padding: $container_padding / 2;
900
background-color: $bg_color;
901
902
// on OSD
903
.osd & { background-color: transparent; }
904
905
// stand-alone OSD toolbars
906
&.osd {
907
transition: $shadow_transition;
908
padding: $container_padding;
909
border-radius: 2px;
910
box-shadow: $z-depth-2;
911
background-color: $base_color;
912
913
&:backdrop { box-shadow: $z-depth-1; }
914
915
&.left,
916
&.right,
917
&.top,
918
&.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
919
920
button { @extend %button_basic.flat; }
921
}
922
923
// toolbar separators
924
&.horizontal separator { margin: $container_padding / 2; }
925
&.vertical separator { margin: $container_padding / 2; }
926
927
&:not(.inline-toolbar):not(.osd) {
928
scale,
929
entry,
930
spinbutton,
931
button { margin: $container_padding / 2; }
932
933
switch { margin: ($container_padding / 2 + $container_padding) ($container_padding / 2); }
934
}
935
}
936
937
//searchbar, location-bar & inline-toolbar
938
.inline-toolbar {
939
padding: $container_padding;
940
border-style: solid;
941
border-width: 0 1px 1px;
942
border-color: $borders_color;
943
background-color: $secondary_base_color;
944
}
945
946
searchbar,
947
.location-bar {
948
padding: $container_padding;
949
border-style: solid;
950
border-width: 0 0 1px;
951
border-color: $borders_color;
952
background-color: $bg_color;
953
background-clip: border-box;
954
}
955
956
957
/***************
958
* Header bars *
959
***************/
960
%titlebar,
961
headerbar {
962
transition: background-color $material_faster $material_ease_out, color $material_faster $material_ease_out;
963
min-height: $large_size;
964
padding: 0 $container_padding;
965
box-shadow: $z-depth-1, inset 0 1px $secondary_highlight_color;
966
background-color: $headerbar_color;
967
color: $selected_fg_color;
968
969
&:backdrop {
970
color: $secondary_selected_fg_color;
971
}
972
973
.title {
974
padding-left: 12px;
975
padding-right: 12px;
976
font-weight: bold;
977
}
978
979
.subtitle {
980
padding-left: 12px;
981
padding-right: 12px;
982
font-size: smaller;
983
984
@extend .dim-label;
985
}
986
987
button:not(.suggested-action):not(.destructive-action) {
988
@extend %button_basic.flat;
989
990
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
991
currentColor 0%,
992
transparent 0%)
993
0 0 0 / 0 0 0px;
994
color: gtkalpha(currentColor, $enabled_opacity);
995
996
&:hover, &:active { color: currentColor; }
997
998
&:disabled {
999
color: gtkalpha(currentColor, $enabled_opacity * $disabled_opacity);
1000
1001
> label { color: inherit; }
1002
}
1003
1004
&:checked {
1005
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1006
currentColor 100%,
1007
transparent 0%)
1008
0 0 2 / 0 0 2px;
1009
background-color: transparent;
1010
color: currentColor;
1011
1012
&:disabled {
1013
background-color: transparent;
1014
color: gtkalpha(currentColor, $disabled_opacity);
1015
1016
> label { color: inherit; }
1017
}
1018
}
1019
}
1020
1021
button.suggested-action, button.destructive-action {
1022
&:disabled {
1023
color: gtkalpha(currentColor, $disabled_opacity);
1024
1025
> label { color: inherit; }
1026
}
1027
}
1028
1029
&.selection-mode {
1030
transition: background-color 0 $material_slower, color $material_faster $material_ease_out;
1031
animation: header_ripple_effect $material_slower $material_ease_out;
1032
// box-shadow: $z-depth-1, inset 0 1px $secondary_highlight_color;
1033
background-color: $selected_bg_color;
1034
color: $selected_fg_color;
1035
1036
&:backdrop {
1037
color: $secondary_selected_fg_color;
1038
}
1039
1040
.subtitle:link { @extend *:link:selected; }
1041
1042
button:not(.suggested-action):not(.destructive-action) {
1043
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1044
currentColor 0%,
1045
transparent 0%)
1046
0 0 0 / 0 0 0px;
1047
// color: gtkalpha(currentColor, $enabled_opacity);
1048
1049
&, &:hover, &:active { color: currentColor; }
1050
1051
&:disabled {
1052
color: gtkalpha(currentColor, $disabled_opacity);
1053
1054
> label { color: inherit; }
1055
}
1056
1057
&:checked {
1058
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1059
currentColor 100%,
1060
transparent 0%)
1061
0 0 2 / 0 0 2px;
1062
color: currentColor;
1063
1064
&:disabled {
1065
color: gtkalpha(currentColor, $disabled_opacity);
1066
1067
> label { color: inherit; }
1068
}
1069
}
1070
}
1071
1072
.selection-menu {
1073
padding-left: 16px;
1074
padding-right: 16px;
1075
1076
GtkArrow { -GtkArrow-arrow-scaling: 1; }
1077
1078
.arrow { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1079
}
1080
}
1081
1082
.fullscreen &,
1083
.tiled &,
1084
.maximized & {
1085
border-radius: 0; // squared corners when the window is max'd or tiled
1086
box-shadow: $z-depth-1;
1087
}
1088
1089
&.default-decoration {
1090
min-height: $small_size;
1091
padding: $container_padding;
1092
border-width: 0;
1093
1094
button.titlebutton {
1095
min-height: $small_size;
1096
min-width: $small_size;
1097
margin: 0;
1098
padding: 0;
1099
1100
&:active { // add fallback
1101
background-image: radial-gradient(circle farthest-corner at center,
1102
gtkalpha(currentColor, $lower_opacity / 2) 100%,
1103
transparent 0%),
1104
image(gtkalpha(currentColor, $lower_opacity / 2));
1105
}
1106
}
1107
}
1108
}
1109
1110
headerbar {
1111
// add vertical margins to headerbar entries, buttons and separators to avoid them spanning the whole height
1112
entry,
1113
spinbutton,
1114
// separator,
1115
button {
1116
margin-top: $container_padding;
1117
margin-bottom: $container_padding;
1118
}
1119
}
1120
1121
.titlebar {
1122
border-top-left-radius: 2px;
1123
border-top-right-radius: 2px;
1124
}
1125
1126
headerbar {
1127
separator:first-child + &, // tackles the paned container case
1128
&:first-child {
1129
border-top-left-radius: 2px;
1130
1131
.tiled &,
1132
.maximized & { border-radius: 0; }
1133
}
1134
1135
&:last-child {
1136
border-top-right-radius: 2px;
1137
1138
.tiled &,
1139
.maximized & { border-radius: 0; }
1140
}
1141
}
1142
1143
.titlebar:not(headerbar) {
1144
window.csd > & {
1145
// in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
1146
padding: 0;
1147
background-color: transparent;
1148
background-image: none;
1149
border-style: none;
1150
box-shadow: none;
1151
}
1152
1153
> separator {
1154
background-color: $headerbar_color;
1155
background-image: image($borders_color);
1156
}
1157
1158
@extend %titlebar;
1159
}
1160
1161
1162
/************
1163
* Pathbars *
1164
************/
1165
.path-bar button {
1166
&.text-button, &.image-button, & {
1167
padding-left: 6px;
1168
padding-right: 6px;
1169
}
1170
1171
&.text-button.image-button, & {
1172
// label:last-child { padding-left: 2px; padding-right: 8px; }
1173
// label:first-child { padding-left: 8px; padding-right: 2px; }
1174
}
1175
1176
image {
1177
padding-left: 4px;
1178
padding-right: 4px;
1179
}
1180
1181
&.slider-button {
1182
padding-left: 0;
1183
padding-right: 0;
1184
}
1185
}
1186
1187
1188
/**************
1189
* Tree Views *
1190
**************/
1191
treeview.view {
1192
-GtkTreeView-grid-line-width: 1;
1193
-GtkTreeView-grid-line-pattern: '';
1194
-GtkTreeView-tree-line-width: 1;
1195
-GtkTreeView-tree-line-pattern: '';
1196
-GtkTreeView-expander-size: 16;
1197
1198
border-left-color: $track_color; // this is actually the tree lines color,
1199
border-top-color: $borders_color; // while this is the grid lines color, better then nothing
1200
1201
rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
1202
1203
&:hover, &:active, &:selected { border-radius: 0; }
1204
1205
&.separator {
1206
min-height: 1px + 2px * 2;
1207
color: $borders_color;
1208
}
1209
1210
&:drop(active) {
1211
border-style: solid none;
1212
border-width: 1px;
1213
border-color: $accent_bg_color;
1214
1215
&.after { border-top-style: none; }
1216
1217
&.before { border-bottom-style: none; }
1218
}
1219
1220
&.expander {
1221
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1222
-gtk-icon-transform: rotate(-90deg);
1223
1224
&:dir(rtl) { -gtk-icon-transform: rotate(90deg); }
1225
1226
&:checked { -gtk-icon-transform: unset; }
1227
1228
color: $secondary_fg_color;
1229
1230
&:hover, &:active { color: $fg_color; }
1231
1232
&:disabled { color: $insensitive_secondary_fg_color; }
1233
1234
&:selected {
1235
color: $secondary_selected_fg_color;
1236
1237
&:hover, &:active { color: $selected_fg_color; }
1238
1239
&:disabled { color: $insensitive_secondary_selected_fg_color; }
1240
}
1241
}
1242
1243
&.progressbar { // progress bar in treeviews
1244
border-style: none none solid;
1245
border-width: $bar_size;
1246
border-color: $selected_bg_color;
1247
background-color: transparent;
1248
background-image: none;
1249
1250
&:selected { border-color: currentColor; }
1251
}
1252
1253
&.trough { // progress bar trough in treeviews
1254
border-style: none none solid;
1255
border-width: $bar_size;
1256
border-color: scale-alpha($selected_bg_color, $lower_opacity);
1257
background-color: transparent;
1258
background-image: none;
1259
1260
&:selected { border-color: $track_color; }
1261
}
1262
1263
header {
1264
button {
1265
@extend row.activatable;
1266
1267
padding: 2px 6px;
1268
border-style: none solid solid none;
1269
border-width: 1px;
1270
border-color: $borders_color;
1271
border-radius: 0;
1272
background-clip: border-box;
1273
1274
&, &:hover, &:active { box-shadow: none; }
1275
1276
&, &:disabled { background-color: $base_color; }
1277
1278
&:last-child { border-right-style: none; }
1279
}
1280
}
1281
1282
button.dnd,
1283
header.button.dnd { // for treeview-like derive widgets
1284
padding: 2px 6px;
1285
border-style: none solid solid;
1286
border-width: 1px;
1287
border-color: $borders_color;
1288
border-radius: 0;
1289
box-shadow: none;
1290
background-color: $base_color;
1291
background-clip: border-box;
1292
color: $selected_bg_color;
1293
}
1294
}
1295
1296
1297
/*********
1298
* Menus *
1299
*********/
1300
menubar,
1301
.menubar {
1302
-GtkWidget-window-dragging: true;
1303
padding: 0;
1304
// box-shadow: inset 0 -1px $borders_color;
1305
background-color: $headerbar_color;
1306
1307
> menuitem {
1308
transition: background-color $material_faster $material_ease_out;
1309
min-height: 20px;
1310
padding: 4px 8px;
1311
color: $secondary_selected_fg_color;
1312
1313
&:hover { //Seems like it :hover even with keyboard focus
1314
transition: none;
1315
background-color: gtkalpha(currentColor, $lower_opacity / 2);
1316
color: $selected_fg_color;
1317
}
1318
1319
&:disabled { color: $insensitive_secondary_selected_fg_color; }
1320
}
1321
}
1322
1323
menu,
1324
.menu {
1325
margin: 4px 0;
1326
padding: 4px 0;
1327
background-color: $base_color;
1328
border: 1px solid $borders_color; // adds borders in a non composited env
1329
1330
.csd & {
1331
border: none; // axes borders in a composited env
1332
border-radius: 2px;
1333
}
1334
1335
menuitem {
1336
transition: background-color $material_faster $material_ease_out;
1337
min-height: 20px;
1338
min-width: 40px;
1339
padding: 4px 8px;
1340
font: initial;
1341
text-shadow: none;
1342
1343
&:hover {
1344
transition: none;
1345
background-color: gtkalpha(currentColor, $lower_opacity / 2);
1346
}
1347
1348
&:disabled { color: $insensitive_fg_color; }
1349
1350
// submenu indicators
1351
arrow {
1352
min-height: 16px;
1353
min-width: 16px;
1354
1355
&:dir(ltr) {
1356
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1357
margin-left: 8px;
1358
}
1359
1360
&:dir(rtl) {
1361
-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl');
1362
margin-right: 8px;
1363
}
1364
}
1365
}
1366
1367
// overflow arrows
1368
> arrow {
1369
min-height: 16px;
1370
min-width: 16px;
1371
padding: 4px;
1372
border-radius: 0;
1373
background-color: $base_color;
1374
color: $secondary_fg_color;
1375
1376
&.top {
1377
margin-top: -4px;
1378
border-bottom: 1px solid $borders_color;
1379
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
1380
}
1381
1382
&.bottom {
1383
margin-bottom: -4px;
1384
border-top: 1px solid $borders_color;
1385
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1386
}
1387
1388
&:hover {
1389
background-image: image(gtkalpha(currentColor, $lower_opacity / 2));
1390
color: $fg_color;
1391
}
1392
1393
&:disabled {
1394
border-color: transparent;
1395
background-color: transparent;
1396
color: transparent;
1397
// color: $insensitive_secondary_fg_color;
1398
}
1399
}
1400
1401
separator { margin: 4px 0; }
1402
}
1403
1404
menuitem {
1405
accelerator { color: gtkalpha(currentColor, $hint_opacity); }
1406
1407
check,
1408
radio {
1409
&:dir(ltr) { margin-right: -8px; margin-left: -16px; }
1410
&:dir(rtl) { margin-right: -16px; margin-left: -8px; }
1411
}
1412
}
1413
1414
.csd.popup { border-radius: 2px; }
1415
1416
1417
/***************
1418
* Popovers *
1419
***************/
1420
popover.background {
1421
transition: $shadow_transition;
1422
padding: 0;
1423
box-shadow: $z-depth-2;
1424
background-color: $light_color;
1425
1426
&:backdrop { box-shadow: $z-depth-1; }
1427
1428
&, .csd & {
1429
border-style: solid;
1430
border-width: 1px;
1431
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3);
1432
border-radius: 2px + 1px;
1433
}
1434
1435
> list,
1436
> .view,
1437
> toolbar {
1438
border-style: none;
1439
box-shadow: none;
1440
background-color: transparent;
1441
}
1442
1443
&, .csd & {
1444
&.touch-selection,
1445
&.magnifier,
1446
&.osd { @extend %osd; }
1447
}
1448
1449
separator { margin: 4px 0; }
1450
1451
list separator { margin: 0; }
1452
}
1453
1454
/*************
1455
* Notebooks *
1456
*************/
1457
notebook {
1458
> header {
1459
border-width: 1px;
1460
border-color: $borders_color;
1461
background-color: $bg_color;
1462
background-clip: border-box;
1463
1464
&.top {
1465
border-bottom-style: solid;
1466
> tabs {
1467
margin-bottom: -1px;
1468
> tab {
1469
1470
&:hover { box-shadow: inset 0 -2px $track_color; }
1471
1472
&:checked { box-shadow: inset 0 -2px $selected_bg_color; }
1473
}
1474
}
1475
}
1476
1477
&.bottom {
1478
border-top-style: solid;
1479
> tabs {
1480
margin-top: -1px;
1481
> tab {
1482
1483
&:hover { box-shadow: inset 0 2px $track_color; }
1484
1485
&:checked { box-shadow: inset 0 2px $selected_bg_color; }
1486
}
1487
}
1488
}
1489
1490
&.left {
1491
border-right-style: solid;
1492
> tabs {
1493
margin-right: -1px;
1494
> tab {
1495
1496
&:hover { box-shadow: inset -2px 0 $track_color; }
1497
1498
&:checked { box-shadow: inset -2px 0 $selected_bg_color; }
1499
}
1500
}
1501
}
1502
1503
&.right {
1504
border-left-style: solid;
1505
> tabs {
1506
margin-left: -1px;
1507
> tab {
1508
1509
&:hover { box-shadow: inset 2px 0 $track_color; }
1510
1511
&:checked { box-shadow: inset 2px 0 $selected_bg_color; }
1512
}
1513
}
1514
}
1515
1516
&.top > tabs > arrow {
1517
@extend %notebook_vert_arrows;
1518
1519
border-top-style: none;
1520
}
1521
1522
&.bottom > tabs > arrow {
1523
@extend %notebook_vert_arrows;
1524
1525
border-bottom-style: none;
1526
}
1527
1528
@at-root %notebook_vert_arrows {
1529
padding-left: 4px;
1530
padding-right: 4px;
1531
1532
&.down {
1533
margin-left: -8px;
1534
-gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
1535
}
1536
1537
&.up {
1538
margin-right: -8px;
1539
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1540
}
1541
}
1542
1543
&.left > tabs > arrow {
1544
@extend %notebook_horz_arrows;
1545
1546
border-left-style: none;
1547
}
1548
1549
&.right > tabs > arrow {
1550
@extend %notebook_horz_arrows;
1551
1552
border-right-style: none;
1553
}
1554
1555
@at-root %notebook_horz_arrows {
1556
padding-top: 4px;
1557
padding-bottom: 4px;
1558
1559
&.down {
1560
margin-top: -8px;
1561
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
1562
}
1563
1564
&.up {
1565
margin-bottom: -8px;
1566
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1567
}
1568
}
1569
1570
> tabs > arrow {
1571
@extend %button_basic.flat;
1572
1573
min-height: 16px;
1574
min-width: 16px;
1575
border-radius: 0;
1576
}
1577
1578
tab {
1579
transition: $material_transition;
1580
min-height: 24px;
1581
min-width: 24px;
1582
padding: 6px 12px;
1583
1584
outline-offset: -6px;
1585
1586
border-width: 1px; // for reorderable tabs
1587
border-color: transparent; //
1588
1589
color: $secondary_fg_color;
1590
font-weight: 500;
1591
1592
&:hover {
1593
color: $fg_color;
1594
1595
&.reorderable-page {
1596
border-color: $borders_color;
1597
background-color: $secondary_base_color;
1598
}
1599
}
1600
1601
&:disabled { color: $insensitive_secondary_fg_color; }
1602
1603
&:checked {
1604
animation: tab_ripple_effect $material_slower * 3 $material_ease_out;
1605
color: $fg_color;
1606
1607
&:disabled { color: $insensitive_fg_color; }
1608
1609
&.reorderable-page {
1610
border-color: $borders_color;
1611
background-color: $base_color;
1612
}
1613
}
1614
1615
// colors the button like the label, overridden otherwise
1616
button.flat {
1617
// FIXME: generalize .small-button?
1618
min-width: $small_size;
1619
min-height: $small_size;
1620
padding: 0;
1621
1622
@extend %button_basic.image-button;
1623
1624
&:last-child {
1625
margin-left: 6px;
1626
margin-right: -6px;
1627
}
1628
1629
&:first-child {
1630
margin-left: -6px;
1631
margin-right: 6px;
1632
}
1633
}
1634
}
1635
1636
&.top,
1637
&.bottom {
1638
tabs {
1639
padding-left: 8px;
1640
padding-right: 8px;
1641
1642
&:not(:only-child) {
1643
&:first-child { margin-left: 0; }
1644
&:last-child { margin-right: 0; }
1645
}
1646
1647
tab {
1648
&.reorderable-page {
1649
margin: 0 -1px;
1650
border-style: none solid;
1651
}
1652
}
1653
}
1654
}
1655
1656
&.left,
1657
&.right {
1658
tabs {
1659
padding-top: 8px;
1660
padding-bottom: 8px;
1661
1662
&:not(:only-child) {
1663
&:first-child { margin-top: 0; }
1664
&:last-child { margin-bottom: 0; }
1665
}
1666
1667
tab {
1668
&.reorderable-page {
1669
margin: -1px 0;
1670
border-style: solid none;
1671
}
1672
}
1673
}
1674
}
1675
}
1676
1677
> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
1678
background-color: $base_color;
1679
1680
entry,
1681
spinbutton:not(.vertical) { @extend %entry.flat; }
1682
1683
revealer entry,
1684
revealer spinbutton:not(.vertical) { @extend %entry; }
1685
1686
spinbutton:not(.vertical) entry { @extend %spinbutton_entry; }
1687
}
1688
}
1689
1690
1691
/**************
1692
* Scrollbars *
1693
**************/
1694
scrollbar {
1695
$_slider_min_length: 24px;
1696
1697
// disable steppers
1698
@at-root * {
1699
-GtkScrollbar-has-backward-stepper: false;
1700
-GtkScrollbar-has-forward-stepper: false;
1701
}
1702
1703
transition: $material_transition;
1704
background-color: $base_color;
1705
background-clip: $extra_background_clip;
1706
1707
// scrollbar border
1708
&.top { border-bottom: 1px solid $borders_color; }
1709
&.bottom { border-top: 1px solid $borders_color; }
1710
&.left { border-right: 1px solid $borders_color; }
1711
&.right { border-left: 1px solid $borders_color; }
1712
1713
// slider
1714
slider {
1715
transition: all $material_faster $material_ease_out, margin 0, border-width 0;
1716
min-width: 8px;
1717
min-height: 8px;
1718
border: 4px solid transparent;
1719
border-radius: 100px;
1720
background-clip: padding-box;
1721
background-color: $tertiary_fg_color;
1722
1723
&:hover { background-color: $secondary_fg_color; }
1724
1725
&:active { background-color: $fg_color; }
1726
1727
&:disabled { background-color: $insensitive_tertiary_fg_color; }
1728
}
1729
1730
&.fine-tune {
1731
slider {
1732
transition: all $material_faster $material_ease_out, margin 0, border-width 0, min-width 0, min-height 0;
1733
min-width: 4px;
1734
min-height: 4px;
1735
}
1736
1737
&.horizontal slider { margin: 2px 0; }
1738
1739
&.vertical slider { margin: 0 2px; }
1740
}
1741
1742
&.overlay-indicator {
1743
&:not(.dragging):not(.hovering) {
1744
border-color: transparent;
1745
background-color: transparent;
1746
1747
slider {
1748
min-width: 4px;
1749
min-height: 4px;
1750
margin: 2px;
1751
border: 2px solid scale-alpha($base_color, $lower_opacity);
1752
}
1753
1754
button {
1755
min-width: 4px;
1756
min-height: 4px;
1757
margin: 2px;
1758
border: 2px solid scale-alpha($base_color, $lower_opacity);
1759
border-radius: 100px;
1760
background-color: $tertiary_fg_color;
1761
background-clip: padding-box;
1762
-gtk-icon-source: none;
1763
1764
&:disabled { background-color: $insensitive_tertiary_fg_color; }
1765
}
1766
1767
&.horizontal {
1768
slider { min-width: $_slider_min_length; }
1769
1770
button { min-width: 8px; }
1771
}
1772
1773
&.vertical {
1774
slider { min-height: $_slider_min_length; }
1775
1776
button { min-height: 8px; }
1777
}
1778
}
1779
1780
&.dragging,
1781
&.hovering { background-color: scale-alpha($base_color, $higher_opacity); }
1782
}
1783
1784
&.horizontal slider { min-width: $_slider_min_length; }
1785
1786
&.vertical slider { min-height: $_slider_min_length; }
1787
1788
// button styling
1789
button {
1790
@extend %button_basic.flat;
1791
min-width: 16px;
1792
min-height: 16px;
1793
padding: 0;
1794
border-radius: 0;
1795
}
1796
1797
// button icons
1798
&.vertical {
1799
button {
1800
&.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1801
1802
&.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
1803
}
1804
}
1805
1806
&.horizontal {
1807
button {
1808
&.down { -gtk-icon-source: -gtk-icontheme('pan-right-symbolic'); }
1809
1810
&.up { -gtk-icon-source: -gtk-icontheme('pan-left-symbolic'); }
1811
}
1812
}
1813
}
1814
1815
1816
/**********
1817
* Switch *
1818
**********/
1819
switch {
1820
transition: $material_transition;
1821
margin: $container_padding 0;
1822
border: 4px solid transparent;
1823
border-radius: 100px;
1824
background-color: $track_color;
1825
background-clip: padding-box;
1826
font-size: 0;
1827
1828
&:disabled { color: $insensitive_fg_color; }
1829
1830
&:checked {
1831
background-color: scale-alpha($accent_bg_color, 0.5);
1832
1833
&:disabled {
1834
background-color: scale-alpha($accent_bg_color, 0.5 * $disabled_opacity);
1835
color: $insensitive_fg_color;
1836
}
1837
}
1838
1839
slider {
1840
@include entry(normal);
1841
1842
transition: $material_transition, margin 0;
1843
min-width: $small_size;
1844
min-height: $small_size;
1845
margin: -4px 0 -4px -4px;
1846
-gtk-outline-radius: 100px;
1847
border-radius: 100px;
1848
}
1849
1850
&:hover slider { @include entry(focus); }
1851
1852
&:disabled slider { @include entry(insensitive); }
1853
1854
&:checked slider {
1855
transition: $material_transition, margin 0, background-image 0, background-color 0 $material_slower;
1856
animation: needs_attention $material_slower $material_ease_out;
1857
margin: -4px -4px -4px 0;
1858
background-color: $accent_bg_color;
1859
color: $selected_fg_color;
1860
}
1861
1862
&:checked:disabled slider { animation: none; }
1863
1864
row:selected & {
1865
}
1866
}
1867
1868
1869
/*************************
1870
* Check and Radio items *
1871
*************************/
1872
// draw regular check and radio items using our PNG assets
1873
// all assets are rendered from assets.svg. never add pngs directly
1874
1875
//selection-mode
1876
@each $s,$as in ('','-selectionmode'),
1877
(':hover', '-hover-selectionmode'),
1878
(':checked', '-checked-selectionmode'),
1879
(':checked:hover', '-checked-hover-selectionmode') {
1880
.view.content-view.check#{$s}:not(list) {
1881
-gtk-icon-shadow: $z-depth-1;
1882
-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}#{$asset_suffix}.png"),
1883
url("assets/checkbox#{$as}#{$asset_suffix}@2.png"));
1884
margin: 8px;
1885
background-color: transparent;
1886
}
1887
}
1888
1889
checkbutton.text-button,
1890
radiobutton.text-button {
1891
// this is for a nice focus on check and radios text
1892
padding: 2px;
1893
outline-offset: 0;
1894
1895
label:not(:only-child) { margin: 0 4px; }
1896
}
1897
1898
check,
1899
radio {
1900
min-height: 24px;
1901
min-width: 24px;
1902
margin: -12px;
1903
padding: 12px;
1904
1905
@extend %button_basic.flat;
1906
1907
@extend %button_basic.image-button;
1908
1909
&:checked, &:checked:disabled { background-color: transparent; }
1910
1911
&:checked, &:indeterminate { color: $accent_bg_color; }
1912
1913
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); }
1914
1915
// &:only-child { margin: -12px; }
1916
1917
row &:not(:checked):not(:indeterminate) {
1918
color: gtkalpha(currentColor, $enabled_opacity);
1919
1920
&:hover, &:active { color: currentColor; }
1921
}
1922
1923
menu menuitem & {
1924
transition: none;
1925
margin: -16px; // this is a workaround for a menu check/radio size allocation issue
1926
1927
&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $hint_opacity); }
1928
1929
&, &:hover, &:disabled {
1930
background-image: none;
1931
// color: inherit;
1932
// animation: none;
1933
}
1934
}
1935
}
1936
1937
%check,
1938
check {
1939
& { -gtk-icon-source: image(-gtk-recolor(url("assets/check-unchecked-symbolic.svg")),
1940
-gtk-recolor(url("assets/check-unchecked-symbolic.png"))); }
1941
1942
&:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-checked-symbolic.svg")),
1943
-gtk-recolor(url("assets/check-checked-symbolic.png"))); }
1944
1945
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/check-dash-symbolic.svg")),
1946
-gtk-recolor(url("assets/check-dash-symbolic.png"))); }
1947
}
1948
1949
%radio,
1950
radio {
1951
& { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-unchecked-symbolic.svg")),
1952
-gtk-recolor(url("assets/radio-unchecked-symbolic.png"))); }
1953
1954
// &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")),
1955
// -gtk-recolor(url("assets/radio-checked-symbolic.png"))); }
1956
1957
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-dash-symbolic.svg")),
1958
-gtk-recolor(url("assets/radio-dash-symbolic.png"))); }
1959
1960
border-image: -gtk-gradient(radial,
1961
center center, 0,
1962
center center, 0.001,
1963
to($accent_bg_color),
1964
to(transparent))
1965
24 / 24px;
1966
1967
&:checked {
1968
border-image: -gtk-gradient(radial,
1969
center center, 0,
1970
center center, (10 / 48 / 2),
1971
to($accent_bg_color),
1972
to(transparent))
1973
24 / 24px;
1974
}
1975
1976
&:checked:disabled {
1977
border-image: -gtk-gradient(radial,
1978
center center, 0,
1979
center center, (10 / 48 / 2),
1980
to(scale-alpha($accent_bg_color, $disabled_opacity)),
1981
to(transparent))
1982
24 / 24px;
1983
}
1984
1985
&:indeterminate:checked {
1986
border-image: -gtk-gradient(radial,
1987
center center, 0,
1988
center center, 0.001,
1989
to($accent_bg_color),
1990
to(transparent))
1991
24 / 24px;
1992
}
1993
}
1994
1995
// let's animate things
1996
@keyframes check_check {
1997
from { -gtk-icon-transform: rotate(90deg); }
1998
to { -gtk-icon-transform: unset; }
1999
}
2000
2001
@keyframes check_radio { // FIXME: cannot animate border-image
2002
from {
2003
border-image: -gtk-gradient(radial,
2004
center center, 0,
2005
center center, 0.001,
2006
to($accent_bg_color),
2007
to(transparent))
2008
24 / 24px;
2009
}
2010
2011
to {
2012
border-image: -gtk-gradient(radial,
2013
center center, 0,
2014
center center, (10 / 48 / 2),
2015
to($accent_bg_color),
2016
to(transparent))
2017
24 / 24px;
2018
}
2019
}
2020
2021
@keyframes check_indeterminate {
2022
from { -gtk-icon-transform: unset; }
2023
50% { -gtk-icon-transform: scale(0, 1); }
2024
to { -gtk-icon-transform: unset; }
2025
}
2026
2027
%check_checked,
2028
check:not(:indeterminate):checked { animation: check_check $material_slower $material_ease; }
2029
2030
check:not(:indeterminate):checked:active { animation: check_check $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; }
2031
2032
// %radio_checked,
2033
// radio:not(:indeterminate):checked { animation: check_radio $material_slower $material_ease; }
2034
2035
// radio:not(:indeterminate):checked:active { animation: check_radio $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; }
2036
2037
%indeterminate_checked,
2038
check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate $material_slower $material_ease; }
2039
2040
check:indeterminate:checked:active, radio:indeterminate:checked:active { animation: check_indeterminate $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; }
2041
2042
// no animations in menus
2043
menu menuitem {
2044
check:not(:indeterminate):checked,
2045
radio:not(:indeterminate):checked,
2046
check:indeterminate:checked,
2047
radio:indeterminate:checked { animation: none; }
2048
}
2049
2050
treeview.view check,
2051
treeview.view radio {
2052
padding: 0;
2053
2054
&:checked:hover, &:selected:checked:hover { background-image: none; }
2055
2056
& {
2057
color: $secondary_fg_color;
2058
2059
&:hover, &:active { color: $fg_color; }
2060
2061
&:disabled { color: $insensitive_secondary_fg_color; }
2062
2063
&:checked, &:indeterminate { color: $accent_bg_color; }
2064
2065
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); }
2066
}
2067
2068
&:selected {
2069
color: $secondary_selected_fg_color;
2070
2071
&:hover, &:active { color: $selected_fg_color; }
2072
2073
&:disabled { color: $insensitive_secondary_selected_fg_color; }
2074
2075
&:checked, &:indeterminate { color: $accent_bg_color; }
2076
2077
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); }
2078
}
2079
}
2080
2081
treeview.view radio:checked {
2082
-gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")),
2083
-gtk-recolor(url("assets/radio-checked-symbolic.png")));
2084
border-image: none;
2085
}
2086
2087
2088
/************
2089
* GtkScale *
2090
************/
2091
scale {
2092
// sizing
2093
2094
$_marks_lenght: 8px;
2095
$_marks_distance: 8px;
2096
2097
min-height: 12px;
2098
min-width: 12px;
2099
padding: 12px;
2100
2101
* { transition: $material_transition; }
2102
2103
// the slider is inside the trough, so to have make it bigger there's a negative margin
2104
slider {
2105
min-height: $small_size;
2106
min-width: $small_size;
2107
margin: -10px;
2108
}
2109
2110
// the backing bit
2111
trough {
2112
outline-offset: 2px;
2113
background-color: $track_color;
2114
2115
&:disabled { color: $insensitive_fg_color; }
2116
}
2117
2118
// the colored part of the backing bit
2119
highlight {
2120
background-color: $accent_bg_color;
2121
2122
&:disabled { background-color: transparent; }
2123
}
2124
2125
// this is another differently styled part of the backing bit, the most relevant use case is for example
2126
// in media player to indicate how much video stream as been cached
2127
fill {
2128
background-color: $track_color;
2129
2130
&:disabled { background-color: transparent; }
2131
}
2132
2133
slider {
2134
transition: all $material_faster $material_ease;
2135
// border-radius: 100%;
2136
// background-color: $accent_bg_color;
2137
background-repeat: no-repeat;
2138
background-position: center;
2139
2140
@each $s,$as in ('',''),
2141
(':disabled','-insensitive') {
2142
&#{$s} {
2143
$_url: 'assets/slider#{$as}#{$asset_suffix}';
2144
background-image: -gtk-scaled(url('#{$_url}.png'),
2145
url('#{$_url}@2.png'));
2146
}
2147
}
2148
2149
background-size: calc(100% - 8px);
2150
2151
&:hover { background-size: calc(100% - 4px); }
2152
2153
&:active { background-size: calc(100% - 0px); }
2154
}
2155
2156
// click-and-hold the slider to activate
2157
&.fine-tune {
2158
// to make the slider shrink in fine-tune mode
2159
slider { background-size: calc(100% - 12px); }
2160
}
2161
2162
value { color: gtkalpha(currentColor, $hint_opacity); }
2163
2164
marks {
2165
color: $track_color;
2166
2167
@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
2168
(bottom, bottom, top),
2169
(top, left, right),
2170
(bottom, right, left) {
2171
&.#{$marks_class} {
2172
margin-#{$marks_margin}: $_marks_distance;
2173
margin-#{$marks_pos}: -($_marks_distance + $_marks_lenght);
2174
}
2175
}
2176
}
2177
2178
&.horizontal {
2179
indicator {
2180
min-height: $_marks_lenght;
2181
min-width: 1px;
2182
}
2183
}
2184
2185
&.vertical {
2186
indicator {
2187
min-height: 1px;
2188
min-width: $_marks_lenght;
2189
}
2190
}
2191
2192
// *WARNING* scale with marks madness following
2193
2194
// FIXME: OSD and selected list rows missing, I don't feel like adding the other 144 assets needed for those...
2195
$suffix: if($variant == 'light', '', '-dark');
2196
2197
@each $dir_class, $dir_infix in ('horizontal', 'horz'),
2198
('vertical', 'vert') {
2199
@each $marks_infix, $nth_child in ('scale-has-marks-above', ':last-child:not(:only-child)'),
2200
('scale-has-marks-below', ':first-child:not(:only-child)') {
2201
@each $state, $state_infix in ('', ''),
2202
(':disabled', '-insensitive') {
2203
&.#{$dir_class} {
2204
%#{$marks_infix}-#{$dir_infix},
2205
contents#{$nth_child} > trough > slider {
2206
&#{$state} {
2207
$_scale_asset: 'assets/slider-#{$dir_infix}-#{$marks_infix}#{$state_infix}#{$suffix}';
2208
2209
background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png'));
2210
}
2211
2212
@if $dir_class == 'horizontal' {
2213
min-height: 30px;
2214
min-width: $small_size;
2215
2216
@if $marks_infix == 'scale-has-marks-above' {
2217
margin-top: -16px;
2218
2219
background-position: center calc(100% - 4px);
2220
2221
&:hover { background-position: center calc(100% - 2px); }
2222
2223
&:active { background-position: center calc(100% - 0px); }
2224
}
2225
2226
@if $marks_infix == 'scale-has-marks-below' {
2227
margin-bottom: -16px;
2228
2229
background-position: center calc(4px);
2230
2231
&:hover { background-position: center calc(2px); }
2232
2233
&:active { background-position: center calc(0px); }
2234
}
2235
}
2236
2237
@if $dir_class == 'vertical' {
2238
min-height: $small_size;
2239
min-width: 30px;
2240
2241
@if $marks_infix == 'scale-has-marks-above' {
2242
margin-left: -16px;
2243
2244
background-position: calc(4px) center;
2245
2246
&:hover { background-position: calc(2px) center; }
2247
2248
&:active { background-position: calc(0px) center; }
2249
}
2250
2251
@if $marks_infix == 'scale-has-marks-below' {
2252
margin-right: -16px;
2253
2254
background-position: calc(100% - 4px) center;
2255
2256
&:hover { background-position: calc(100% - 2px) center; }
2257
2258
&:active { background-position: calc(100% - 0px) center; }
2259
}
2260
}
2261
}
2262
2263
@at-root %#{$marks_infix}-#{$dir_infix}-fine-tune,
2264
&.fine-tune contents#{$nth_child} > trough > slider {
2265
// bigger negative margins to make the trough grow here as well
2266
2267
@if $dir_class == 'horizontal' {
2268
@if $marks_infix == 'scale-has-marks-above' { background-position: center calc(100% - 6px); }
2269
2270
@if $marks_infix == 'scale-has-marks-below' { background-position: center calc(6px); }
2271
}
2272
2273
@if $dir_class == 'vertical' {
2274
@if $marks_infix == 'scale-has-marks-above' { background-position: calc(6px) center; }
2275
2276
@if $marks_infix == 'scale-has-marks-below' { background-position: calc(100% - 6px) center; }
2277
}
2278
}
2279
}
2280
}
2281
}
2282
}
2283
2284
&.color {
2285
min-height: 0;
2286
min-width: 0;
2287
2288
&.horizontal {
2289
padding: 0 0 12px 0;
2290
2291
trough {
2292
padding-bottom: $bar_size;
2293
}
2294
2295
slider {
2296
@extend %scale-has-marks-above-horz;
2297
2298
margin-bottom: -10px - $bar_size;
2299
margin-top: 0;
2300
}
2301
}
2302
2303
&.vertical {
2304
&:dir(ltr) {
2305
padding: 0 0 0 12px;
2306
2307
trough {
2308
padding-left: $bar_size;
2309
}
2310
2311
slider {
2312
@extend %scale-has-marks-below-vert;
2313
2314
margin-left: -10px - $bar_size;
2315
margin-right: 0;
2316
}
2317
}
2318
2319
&:dir(rtl) {
2320
padding: 0 12px 0 0;
2321
2322
trough {
2323
padding-right: $bar_size;
2324
}
2325
2326
slider {
2327
@extend %scale-has-marks-above-vert;
2328
2329
margin-right: -10px - $bar_size;
2330
margin-left: 0;
2331
}
2332
}
2333
}
2334
2335
&.fine-tune {
2336
&.horizontal {
2337
slider {
2338
@extend %scale-has-marks-above-horz-fine-tune;
2339
}
2340
}
2341
2342
&.vertical {
2343
&:dir(ltr) {
2344
slider {
2345
@extend %scale-has-marks-below-vert-fine-tune;
2346
}
2347
}
2348
2349
&:dir(rtl) {
2350
slider {
2351
@extend %scale-has-marks-above-vert-fine-tune;
2352
}
2353
}
2354
}
2355
}
2356
}
2357
}
2358
2359
2360
/*****************
2361
* Progress bars *
2362
*****************/
2363
progressbar {
2364
// sizing
2365
&.horizontal {
2366
trough,
2367
progress { min-height: $bar_size; }
2368
}
2369
2370
&.vertical {
2371
trough,
2372
progress { min-width: $bar_size; }
2373
}
2374
2375
// FIXME: insensitive state missing and some other state should be set probably
2376
color: $tertiary_fg_color;
2377
font-size: smaller;
2378
2379
trough { background-color: scale-alpha($selected_bg_color, $lower_opacity); }
2380
2381
progress { background-color: $selected_bg_color; }
2382
2383
&.osd { // progressbar.osd used for epiphany page loading progress
2384
// min-width: $bar_size;
2385
// min-height: $bar_size;
2386
// background-color: transparent;
2387
2388
// trough { background-color: transparent; }
2389
2390
progress {
2391
}
2392
}
2393
}
2394
2395
2396
/*************
2397
* Level Bar *
2398
*************/
2399
levelbar {
2400
block {
2401
min-width: $medium_size;
2402
min-height: $bar_size;
2403
}
2404
2405
&.vertical block {
2406
min-width: $bar_size;
2407
min-height: $medium_size;
2408
}
2409
2410
trough {
2411
padding: 2px;
2412
border-radius: 2px;
2413
2414
@include entry(normal);
2415
2416
&:disabled { @include entry(insensitive); }
2417
}
2418
2419
&.horizontal.discrete block { margin: 0 1px; }
2420
2421
&.vertical.discrete block { margin: 1px 0; }
2422
2423
&.horizontal.discrete trough { padding: 2px 1px; }
2424
2425
&.vertical.discrete trough { padding: 1px 2px; }
2426
2427
block {
2428
&.low {
2429
background-color: $warning_color;
2430
}
2431
2432
&.high {
2433
background-color: $selected_bg_color;
2434
}
2435
2436
&.full {
2437
background-color: $success_color;
2438
}
2439
2440
&.empty {
2441
background-color: $track_color;
2442
color: $insensitive_fg_color;
2443
}
2444
}
2445
}
2446
2447
2448
/****************
2449
* Print dialog *
2450
*****************/
2451
printdialog {
2452
paper {
2453
padding: 0;
2454
border: 1px solid $borders_color;
2455
background: $base_color;
2456
color: $fg_color;
2457
}
2458
2459
.dialog-action-box { margin: 12px; }
2460
}
2461
2462
2463
/**********
2464
* Frames *
2465
**********/
2466
frame > border,
2467
.frame {
2468
margin: 0;
2469
padding: 0;
2470
border: 1px solid $borders_color;
2471
border-radius: 0;
2472
box-shadow: none;
2473
2474
&.flat { border-style: none; }
2475
}
2476
2477
actionbar > revealer > box {
2478
padding: $container_padding;
2479
border-top: 1px solid $borders_color;
2480
}
2481
2482
scrolledwindow {
2483
viewport.frame { // avoid double borders when viewport inside scrolled window
2484
border-style: none;
2485
}
2486
2487
// This is used when content is touch-dragged past boundaries.
2488
// draws a box on top of the content, the size changes programmatically.
2489
overshoot {
2490
&.top { @include overshoot(top); }
2491
2492
&.bottom { @include overshoot(bottom); }
2493
2494
&.left { @include overshoot(left); }
2495
2496
&.right { @include overshoot(right); }
2497
}
2498
2499
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
2500
undershoot {
2501
&.top { @include undershoot(top); }
2502
2503
&.bottom { @include undershoot(bottom); }
2504
2505
&.left { @include undershoot(left); }
2506
2507
&.right { @include undershoot(right); }
2508
}
2509
2510
junction { // the small square between two scrollbars
2511
border-style: solid none none solid;
2512
border-width: 1px;
2513
border-color: $borders_color;
2514
background-color: $base_color;
2515
2516
&:dir(rtl) { border-style: solid solid none none; }
2517
}
2518
}
2519
2520
//vbox and hbox separators
2521
separator {
2522
min-width: 1px;
2523
min-height: 1px;
2524
background: $borders_color;
2525
}
2526
2527
2528
/*********
2529
* Lists *
2530
*********/
2531
list {
2532
border-color: $borders_color;
2533
background-color: $base_color;
2534
2535
row { padding: 2px; }
2536
}
2537
2538
row {
2539
transition: $material_transition;
2540
2541
&:hover { transition: none; }
2542
2543
&.activatable {
2544
background-image: radial-gradient(circle farthest-corner at center,
2545
gtkalpha(currentColor, 0) 100%,
2546
transparent 0%),
2547
image(gtkalpha(currentColor, 0));
2548
2549
&:hover {
2550
background-image: radial-gradient(circle farthest-corner at center,
2551
gtkalpha(currentColor, 0) 100%,
2552
transparent 0%),
2553
image(gtkalpha(currentColor, 0.05));
2554
}
2555
2556
&.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
2557
&:active {
2558
transition: $material_transition, background-image 0;
2559
animation: row_ripple_effect $material_slower $material_ease_out forwards;
2560
}
2561
}
2562
2563
&:selected { @extend %selected_items; }
2564
}
2565
2566
2567
/*********************
2568
* App Notifications *
2569
*********************/
2570
.app-notification,
2571
.app-notification.frame {
2572
@extend %osd;
2573
2574
@extend toolbar.osd;
2575
2576
margin: 8px;
2577
2578
border { border: none; }
2579
}
2580
2581
2582
/*************
2583
* Expanders *
2584
*************/
2585
expander {
2586
arrow {
2587
transition: all $material_faster $material_ease;
2588
min-width: 16px;
2589
min-height: 16px;
2590
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
2591
-gtk-icon-transform: rotate(-90deg);
2592
2593
&:dir(rtl) { -gtk-icon-transform: rotate(90deg); }
2594
2595
&:checked { -gtk-icon-transform: unset; }
2596
2597
color: $secondary_fg_color;
2598
2599
&:hover, &:active { color: $fg_color; }
2600
2601
&:disabled { color: $insensitive_secondary_fg_color; }
2602
2603
&:selected {
2604
color: $secondary_selected_fg_color;
2605
2606
&:hover, &:active { color: $selected_fg_color; }
2607
2608
&:disabled { color: $insensitive_secondary_selected_fg_color; }
2609
}
2610
}
2611
}
2612
2613
2614
/************
2615
* Calendar *
2616
***********/
2617
calendar {
2618
padding: 1px;
2619
border: 1px solid $borders_color;
2620
color: $fg_color;
2621
2622
&:disabled { color: $insensitive_fg_color; }
2623
2624
&:selected {
2625
@extend %selected_items;
2626
2627
border-radius: 2px + 1px;
2628
}
2629
2630
&.header {
2631
border-style: none none solid;
2632
border-radius: 0;
2633
}
2634
2635
&.button { @extend %button_basic.flat; }
2636
2637
&.highlight {
2638
color: gtkalpha(currentColor, $hint_opacity);
2639
font-weight: 500;
2640
}
2641
2642
&:indeterminate { color: gtkalpha(currentColor, $disabled_opacity); }
2643
}
2644
2645
2646
/***********
2647
* Dialogs *
2648
***********/
2649
messagedialog { // Message Dialog styling
2650
&.background { background-color: $light_color; }
2651
2652
.titlebar {
2653
min-height: $small_size;
2654
border-style: none;
2655
box-shadow: inset 0 1px $highlight_color;
2656
background-color: $light_color;
2657
}
2658
2659
&.csd { // rounded bottom border styling for csd version
2660
&.background {
2661
// bigger radius for better antialiasing
2662
border-bottom-left-radius: 2px;
2663
border-bottom-right-radius: 2px;
2664
}
2665
2666
.dialog-action-area button {
2667
padding: 8px 16px;
2668
border-top: 1px solid $borders_color;
2669
border-radius: 0;
2670
2671
@extend %button_basic.flat;
2672
2673
&:first-child{ border-bottom-left-radius: 2px; }
2674
2675
&:last-child { border-bottom-right-radius: 2px; }
2676
}
2677
}
2678
}
2679
2680
filechooser {
2681
.dialog-action-box { border-top: 1px solid $borders_color; }
2682
2683
#pathbarbox { border-bottom: 1px solid $borders_color; }
2684
}
2685
2686
filechooserbutton:drop(active) {
2687
box-shadow: none;
2688
}
2689
2690
2691
/***********
2692
* Sidebar *
2693
***********/
2694
.sidebar {
2695
border-style: none;
2696
background-color: $light_color;
2697
2698
@at-root %sidebar_left,
2699
&:dir(ltr),
2700
&.left,
2701
&.left:dir(rtl) {
2702
border-right: 1px solid $borders_color;
2703
border-left-style: none;
2704
}
2705
2706
@at-root %sidebar_right
2707
&:dir(rtl),
2708
&.right {
2709
border-left: 1px solid $borders_color;
2710
border-right-style: none;
2711
}
2712
2713
list { background-color: transparent; }
2714
2715
paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }}
2716
}
2717
2718
stacksidebar {
2719
&.sidebar {
2720
&:dir(ltr),
2721
&.left,
2722
&.left:dir(rtl) { list { @extend %sidebar_left; }}
2723
2724
&:dir(rtl),
2725
&.right { list { @extend %sidebar_right; }}
2726
}
2727
2728
row {
2729
padding: 10px 4px;
2730
2731
> label {
2732
padding-left: 6px;
2733
padding-right: 6px;
2734
}
2735
2736
&.needs-attention > label { @extend %needs_attention; }
2737
}
2738
}
2739
2740
2741
/****************
2742
* File chooser *
2743
****************/
2744
placessidebar {
2745
> viewport.frame { border-style: none; }
2746
2747
row {
2748
// Needs overriding of the GtkListBoxRow padding
2749
min-height: 32px;
2750
padding: 0;
2751
2752
// Using margins/padding directly in the SidebarRow
2753
// will make the animation of the new bookmark row jump
2754
> revealer { padding: 0 12px; }
2755
2756
&:selected { color: $selected_fg_color; }
2757
2758
&:disabled { color: $insensitive_fg_color; }
2759
2760
image.sidebar-icon {
2761
opacity: $hint_opacity; // dim the device icons
2762
2763
&:dir(ltr) { padding-right: 8px; }
2764
&:dir(rtl) { padding-left: 8px; }
2765
}
2766
2767
label.sidebar-label {
2768
&:dir(ltr) { padding-right: 2px; }
2769
&:dir(rtl) { padding-left: 2px; }
2770
}
2771
2772
@at-root button.sidebar-button {
2773
@extend %button_basic.flat;
2774
2775
min-height: $small_size;
2776
min-width: $small_size;
2777
margin-top: 0;
2778
margin-bottom: 0;
2779
padding: 0;
2780
border-radius: 100%;
2781
-gtk-outline-radius: 100%;
2782
2783
row:selected & { @extend %button_selected.flat; }
2784
}
2785
2786
&.sidebar-placeholder-row {
2787
min-height: 2px;
2788
padding: 0 8px;
2789
background-image: image($accent_bg_color);
2790
background-clip: content-box;
2791
}
2792
2793
&.sidebar-new-bookmark-row { color: $accent_bg_color; }
2794
2795
&:drop(active):not(:disabled) {
2796
box-shadow: inset 0 0 0 2px $accent_bg_color;
2797
2798
&:selected {
2799
// background-color: $accent_bg_color;
2800
// color: $selected_fg_color;
2801
}
2802
}
2803
}
2804
}
2805
2806
placesview {
2807
.server-list-button > image { -gtk-icon-transform: rotate(0turn); }
2808
2809
.server-list-button:checked > image { -gtk-icon-transform: rotate(-0.5turn); }
2810
2811
// this selects the "connect to server" label
2812
> actionbar > revealer > box > label {
2813
padding-left: 8px;
2814
padding-right: 8px;
2815
}
2816
}
2817
2818
2819
/*********
2820
* Paned *
2821
*********/
2822
paned {
2823
> separator {
2824
min-width: 1px;
2825
min-height: 1px;
2826
-gtk-icon-source: none; // defeats the ugly default handle decoration
2827
border-style: none; // just to be sure
2828
background-color: transparent;
2829
// workaround, using background istead of a border since the border will get rendered twice (?)
2830
background-image: image($borders_color);
2831
background-size: 1px 1px;
2832
2833
&.wide {
2834
min-width: 6px;
2835
min-height: 6px;
2836
background-color: $bg_color;
2837
background-image: image($borders_color), image($borders_color);
2838
background-size: 1px 1px, 1px 1px;
2839
}
2840
}
2841
2842
&.horizontal > separator {
2843
background-repeat: repeat-y;
2844
2845
&:dir(ltr) {
2846
margin: 0 -8px 0 0;
2847
padding: 0 8px 0 0;
2848
background-position: left;
2849
}
2850
2851
&:dir(rtl) {
2852
margin: 0 0 0 -8px;
2853
padding: 0 0 0 8px;
2854
background-position: right;
2855
}
2856
2857
&.wide {
2858
margin: 0;
2859
padding: 0;
2860
background-repeat: repeat-y, repeat-y;
2861
background-position: left, right;
2862
}
2863
}
2864
2865
&.vertical > separator {
2866
margin: 0 0 -8px 0;
2867
padding: 0 0 8px 0;
2868
background-repeat: repeat-x;
2869
background-position: top;
2870
2871
&.wide {
2872
margin: 0;
2873
padding: 0;
2874
background-repeat: repeat-x, repeat-x;
2875
background-position: bottom, top;
2876
}
2877
}
2878
}
2879
2880
2881
/**************
2882
* GtkInfoBar *
2883
**************/
2884
infobar { border-style: none; }
2885
2886
.info { background-color: $info_bg_color; }
2887
2888
.question { background-color: $question_bg_color; }
2889
2890
.warning { background-color: $warning_bg_color; }
2891
2892
.error { background-color: $error_bg_color; }
2893
2894
.info,
2895
.question,
2896
.warning,
2897
.error {
2898
color: $selected_fg_color;
2899
2900
button { @extend %button_selected; }
2901
2902
label:selected {
2903
}
2904
2905
*:link { @extend %link_selected; }
2906
}
2907
2908
2909
/************
2910
* Tooltips *
2911
************/
2912
tooltip {
2913
&.background {
2914
// background-color needs to be set this way otherwise it gets drawn twice
2915
// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
2916
background-color: scale-alpha($base_color, $higher_opacity);
2917
}
2918
2919
// @extend %osd;
2920
2921
// padding: 4px; /* not working */
2922
border-radius: 2px;
2923
box-shadow: none; // otherwise it gets inherited by windowframe.csd
2924
2925
// FIXME: we need a border or tooltips vanish on black background.
2926
decoration { background-color: transparent; }
2927
2928
label {
2929
min-height: 32px - 6px * 2;
2930
padding: 2px 8px - 6px;
2931
}
2932
2933
* { // Yeah this is ugly
2934
padding: 0;
2935
background-color: transparent;
2936
color: inherit;
2937
}
2938
}
2939
2940
2941
/*****************
2942
* Color Chooser *
2943
*****************/
2944
colorswatch {
2945
// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
2946
// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
2947
// applied to the overlay box.
2948
2949
// base color corners rounding
2950
// to avoid the artifacts caused by rounded corner anti-aliasing the base color
2951
// sports a bigger radius.
2952
// nth-child is needed by the custom color strip.
2953
2954
&.top {
2955
border-top-left-radius: $material_radius + 0.5px;
2956
border-top-right-radius: $material_radius + 0.5px;
2957
2958
overlay {
2959
border-top-left-radius: $material_radius;
2960
border-top-right-radius: $material_radius;
2961
}
2962
}
2963
2964
&.bottom {
2965
border-bottom-left-radius: $material_radius + 0.5px;
2966
border-bottom-right-radius: $material_radius + 0.5px;
2967
2968
overlay {
2969
border-bottom-left-radius: $material_radius;
2970
border-bottom-right-radius: $material_radius;
2971
}
2972
}
2973
2974
&.left,
2975
&:first-child:not(.top) {
2976
border-top-left-radius: $material_radius + 0.5px;
2977
border-bottom-left-radius: $material_radius + 0.5px;
2978
2979
overlay {
2980
border-top-left-radius: $material_radius;
2981
border-bottom-left-radius: $material_radius;
2982
}
2983
}
2984
2985
&.right,
2986
&:last-child:not(.bottom) {
2987
border-top-right-radius: $material_radius + 0.5px;
2988
border-bottom-right-radius: $material_radius + 0.5px;
2989
2990
overlay {
2991
border-top-right-radius: $material_radius;
2992
border-bottom-right-radius: $material_radius;
2993
}
2994
}
2995
2996
&.dark overlay { color: white; }
2997
2998
&.light overlay { color: scale-alpha(black, 0.8); }
2999
3000
&.dark { color: white; } // for focus ring
3001
3002
&.light { color: scale-alpha(black, 0.8); } // for focus ring
3003
3004
&:drop(active) {
3005
box-shadow: none;
3006
3007
&.light overlay {
3008
box-shadow: $z-depth-1, 0 0 0 2px $accent_bg_color;
3009
}
3010
3011
&.dark overlay {
3012
box-shadow: $z-depth-1, 0 0 0 2px $accent_bg_color;
3013
}
3014
}
3015
3016
overlay {
3017
transition: $shadow_transition;
3018
box-shadow: $z-depth-1;
3019
3020
&:hover { box-shadow: $z-depth-2; }
3021
}
3022
3023
&#add-color-button {
3024
border-radius: $material_radius $material_radius 0 0;
3025
color: white; // for focus ring
3026
3027
&:only-child { border-radius: $material_radius; }
3028
3029
overlay {
3030
background-image: linear-gradient(to right,
3031
$error_bg_color 25%,
3032
$warning_bg_color 25%, $warning_bg_color 50%,
3033
$info_bg_color 50%, $info_bg_color 75%,
3034
$question_bg_color 75%);
3035
color: white;
3036
}
3037
}
3038
3039
&:disabled {
3040
opacity: $disabled_opacity;
3041
3042
overlay { box-shadow: none; }
3043
}
3044
3045
row:selected & {
3046
}
3047
3048
&#editor-color-sample {
3049
border-radius: $material_radius + 0.5px;
3050
3051
overlay { border-radius: $material_radius; }
3052
3053
// overlay:hover { box-shadow: $z-depth-1; }
3054
}
3055
}
3056
3057
// colorscale popup
3058
colorchooser .popover.osd {
3059
transition: $shadow_transition;
3060
border-radius: 2px;
3061
box-shadow: $z-depth-2;
3062
background-color: $base_color;
3063
3064
&:backdrop { box-shadow: $z-depth-1; }
3065
3066
spinbutton:not(.vertical) { @extend %entry.flat; }
3067
}
3068
3069
3070
/********
3071
* Misc *
3072
********/
3073
//content view (grid/list)
3074
.content-view {
3075
background-color: $bg_color;
3076
3077
// &:hover { -gtk-icon-effect: highlight; }
3078
3079
rubberband { @extend rubberband; }
3080
}
3081
3082
.scale-popup {
3083
.osd & { @extend %osd; }
3084
3085
.osd & button.flat { //FIXME: quick hack, redo properly
3086
}
3087
3088
button { // +/- buttons on GtkVolumeButton popup
3089
}
3090
}
3091
3092
3093
/**********************
3094
* Window Decorations *
3095
*********************/
3096
decoration {
3097
transition: $shadow_transition;
3098
border-radius: 2px 2px 0 0;
3099
box-shadow: $z-depth-4, 0 16px 16px transparent;
3100
3101
// FIXME rationalize shadows
3102
3103
// this is used for the resize cursor area
3104
margin: 8px;
3105
3106
&:backdrop {
3107
// the transparent shadow here is to enforce that the shadow extents don't
3108
// change when we go to backdrop, to prevent jumping windows.
3109
// The biggest shadow should be in the same order then in the active state
3110
// or the jumping will happen during the transition.
3111
box-shadow: $z-depth-2, 0 16px 16px transparent;
3112
}
3113
3114
.fullscreen &,
3115
.tiled & { border-radius: 0; }
3116
3117
.popup & { box-shadow: none; }
3118
3119
// server-side decorations as used by mutter
3120
.ssd & { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16); } //just doing borders, wm draws actual shadows
3121
3122
.csd.popup & {
3123
border-radius: 2px;
3124
box-shadow: $z-depth-2;
3125
}
3126
3127
tooltip.csd & {
3128
border-radius: 2px;
3129
box-shadow: $z-depth-2;
3130
}
3131
3132
messagedialog.csd & {
3133
border-radius: 2px;
3134
// box-shadow: $z-depth-4, 0 16px 16px transparent;
3135
3136
// &:backdrop { box-shadow: $z-depth-2, 0 16px 16px transparent; }
3137
}
3138
3139
.solid-csd & {
3140
margin: 4px;
3141
// border: solid 1px $borders_color;
3142
border-radius: 0;
3143
box-shadow: none;
3144
background-color: $bg_color;
3145
}
3146
}
3147
3148
// Window Close button
3149
button.titlebutton {
3150
// @extend %button_basic.flat;
3151
3152
@extend %button_basic.image-button;
3153
3154
.selection-mode & {
3155
}
3156
}
3157
3158
3159
// catch all extend :)
3160
3161
%selected_items {
3162
background-color: $selected_bg_color;
3163
3164
@at-root %nobg_selected_items, & {
3165
color: $selected_fg_color;
3166
3167
&:disabled { color: $insensitive_selected_fg_color; }
3168
}
3169
}
3170
3171
.monospace { font: Monospace; }
3172
3173
3174
/**********************
3175
* Touch Copy & Paste *
3176
*********************/
3177
//touch selection handlebars for the Popover.osd above
3178
cursor-handle {
3179
border-radius: 100px;
3180
background-color: $accent_bg_color;
3181
background-image: none;
3182
3183
&.top:dir(ltr), &.bottom:dir(rtl) {
3184
padding-left: 6px;
3185
border-top-right-radius: 0;
3186
}
3187
3188
&.bottom:dir(ltr), &.top:dir(rtl) {
3189
padding-right: 6px;
3190
border-top-left-radius: 0;
3191
}
3192
3193
&.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) {
3194
-GtkWidget-text-handle-width: 24;
3195
-GtkWidget-text-handle-height: 30;
3196
3197
$_url: 'assets/slider-horz-scale-has-marks-above#{$asset_suffix}';
3198
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
3199
url('#{$_url}@2.png'));
3200
}
3201
}
3202
3203
.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
3204
3205
button.circular { // FIXME: aggregate to buttons
3206
border-radius: 100px;
3207
-gtk-outline-radius: 100px;
3208
3209
label { padding: 0; }
3210
}
3211
3212
// shortcut window keys
3213
.keycap {
3214
min-width: 28px - 8px * 2;
3215
min-height: 28px - 2px;
3216
margin-top: 2px;
3217
padding-bottom: 2px;
3218
padding-left: 8px;
3219
padding-right: 8px;
3220
3221
border: solid 1px $borders_color;
3222
border-radius: 2px + 1px;
3223
box-shadow: inset 0 -2px $borders_color;
3224
background-color: $base_color;
3225
color: $fg_color;
3226
font-size: smaller;
3227
}
3228
3229
*:drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
3230
transition: $material_transition;
3231
box-shadow: $z-depth-1, inset 0 0 0 2px $accent_bg_color;
3232
caret-color: $accent_bg_color;
3233
}
3234
3235
stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
3236
3237
stackswitcher button.circular,
3238
stackswitcher button.text-button.circular { // FIXME aggregate with buttons
3239
min-width: $medium_size;
3240
min-height: $medium_size;
3241
padding: 0;
3242
}
3243