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