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