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