A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 _common.scss

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