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