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