A fork of the Materia GTK theme.

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

 _common.scss

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