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