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