_common.scss
Unicode text, UTF-8 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
8
$container_padding: 6px;
9
$material_radius: 2px;
10
$material_duration: 0.2s;
11
$material_timing_function: cubic-bezier(0.4, 0, 0.2, 1);
12
13
* {
14
padding: 0;
15
background-clip: padding-box;
16
transition-property: opacity, border-color, border-image, box-shadow,
17
background-color, background-image, text-shadow, icon-shadow;
18
transition-duration: $material_duration;
19
transition-timing-function: $material_timing_function;
20
21
-GtkToolButton-icon-spacing: 4;
22
-GtkTextView-error-underline-color: $error_color;
23
24
-GtkCheckButton-indicator-size: 20;
25
-GtkCheckMenuItem-indicator-size: 16;
26
27
// The size for scrollbars. The slider is 2px smaller, but we keep it
28
// up so that the whole area is sensitive to button presses for the
29
// slider. The stepper button is larger in both directions, the slider
30
// only in the width
31
32
-GtkScrolledWindow-scrollbar-spacing: 0;
33
-GtkScrolledWindow-scrollbars-within-bevel: 1;
34
35
-GtkToolItemGroup-expander-size: 11;
36
-GtkExpander-expander-size: 16;
37
-GtkTreeView-expander-size: 11;
38
39
-GtkTreeView-horizontal-separator: 4;
40
41
-GtkMenu-horizontal-padding: 0;
42
-GtkMenu-vertical-padding: 0;
43
44
-GtkWidget-link-color: $link_color;
45
-GtkWidget-visited-link-color: $link_visited_color;
46
47
-GtkWidget-focus-padding: 2; // FIXME: do we still need these?
48
-GtkWidget-focus-line-width: 1; //
49
50
-GtkWidget-text-handle-width: 20;
51
-GtkWidget-text-handle-height: 20;
52
53
-GtkDialog-button-spacing: 4;
54
-GtkDialog-action-area-border: 0;
55
56
-GtkStatusbar-shadow-type: none;
57
58
// We use the outline properties to signal the focus properties
59
// to the adwaita engine: using real CSS properties is faster,
60
// and we don't use any outlines for now.
61
62
outline-style: solid;
63
outline-width: 2px;
64
outline-color: $track_color;
65
outline-offset: -4px;
66
outline-radius: 2px;
67
}
68
69
70
/***************
71
* Base States *
72
***************/
73
74
.background {
75
background-color: $bg_color;
76
color: $fg_color;
77
}
78
79
/*
80
These wildcard seems unavoidable, need to investigate.
81
Wildcards are bad and troublesome, use them with care,
82
or better, just don't.
83
Everytime a wildcard is used a kitten dies, painfully.
84
*/
85
86
*:insensitive {
87
-gtk-image-effect: dim;
88
}
89
90
.gtkstyle-fallback {
91
background-color: $bg_color;
92
color: $fg_color;
93
&:prelight {
94
background-color: darken($bg_color, 5%);
95
color: $fg_color;
96
}
97
&:active {
98
background-color: darken($bg_color, 10%);
99
color: $fg_color;
100
}
101
&:insensitive {
102
background-color: $bg_color;
103
color: $insensitive_fg_color;
104
}
105
&:selected {
106
background-color: $selected_bg_color;
107
color: $selected_fg_color;
108
}
109
}
110
111
.view {
112
@extend .list-row.activatable;
113
background-color: $base_color;
114
color: $fg_color;
115
116
&:hover, &:active, &:selected { border-radius: 2px; }
117
118
&:insensitive {
119
// background-color: $secondary_base_color;
120
color: $insensitive_fg_color;
121
}
122
123
&:selected { @extend %selected_items; }
124
}
125
126
.rubberband {
127
border: 1px solid $secondary_selected_bg_color;
128
background-color: scale-alpha($secondary_selected_bg_color, $lower_opacity);
129
}
130
131
.label {
132
&.separator {
133
color: $fg_color;
134
@extend .dim-label;
135
}
136
&:selected {
137
@extend %selected_items;
138
}
139
&:insensitive {
140
color: $insensitive_fg_color;
141
}
142
}
143
144
.dim-label {
145
opacity: $hint_opacity;
146
}
147
148
GtkAssistant {
149
.sidebar {
150
padding: 6px 0;
151
border-top: 1px solid $borders_color;
152
&:dir(ltr) { border-right: 1px solid $borders_color; }
153
&:dir(rtl) { border-left: 1px solid $borders_color; }
154
}
155
&.csd .sidebar { border-top-style: none; }
156
.sidebar .label {
157
opacity: $hint_opacity;
158
padding: 5px 12px 6px;
159
font-weight: bold;
160
}
161
.sidebar .label.highlight {
162
opacity: 1;
163
}
164
}
165
166
GtkTextView { // This will get overridden by .view, needed by gedit line numbers
167
background-color: $secondary_base_color;
168
}
169
170
.grid-child {
171
// outline-offset: -2px;
172
padding: 4px;
173
border-radius: 2px;
174
&:selected { @extend %selected_items; }
175
}
176
177
%osd, .osd { opacity: $higher_opacity; }
178
179
/*********************
180
* Spinner Animation *
181
*********************/
182
183
@keyframes spin {
184
to { -gtk-icon-transform: rotate(1turn); }
185
}
186
187
.spinner {
188
background-color: blue;
189
background-image: none;
190
opacity: 0; // non spinning spinner makes no sense
191
-gtk-icon-source: -gtk-icontheme('process-working-symbolic');
192
&:active {
193
opacity: 1;
194
animation: spin 1s linear infinite;
195
&:insensitive {
196
opacity: $disabled_opacity;
197
}
198
}
199
}
200
201
/****************
202
* Text Entries *
203
****************/
204
205
.entry {
206
padding: 7px 8px 8px;
207
border-radius: 2px;
208
@include entry(normal);
209
&:focus { @include entry(focus); }
210
&:insensitive { @include entry(insensitive); }
211
&.flat {
212
border-radius: 0;
213
@include entry(flat-normal);
214
&:focus { @include entry(flat-focus); }
215
&:insensitive { @include entry(flat-insensitive); }
216
}
217
218
&:selected { @extend %selected_items; }
219
220
&.image { // icons inside the entry
221
&.left { padding-left: 2px; }
222
&.right { padding-right: 2px; }
223
}
224
225
&.progressbar {
226
margin: 2px;
227
border-style: none none solid;
228
border-width: 2px;
229
border-color: $selected_bg_color;
230
border-radius: 0;
231
box-shadow: none;
232
background-color: transparent;
233
background-image: none;
234
}
235
236
.linked > &:not(.flat) { @extend %linked; }
237
238
.linked.vertical > &:not(.flat) { @extend %linked_vertical; }
239
240
// entry error and warning style
241
@each $e_type, $e_color in (error, $error_color),
242
(warning, $warning_color) {
243
&.#{$e_type} {
244
@include entry(normal, $e_color);
245
&:focus { @include entry(focus, $e_color); }
246
&:insensitive { @include entry(insensitive, $e_color); }
247
&.flat {
248
@include entry(flat-normal, $e_color);
249
&:focus { @include entry(flat-focus, $e_color); }
250
&:insensitive { @include entry(flat-insensitive, $e_color); }
251
}
252
}
253
}
254
255
&.image { // entry icons colors
256
&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); }
257
&:insensitive { color: gtkalpha(currentColor, $hint_opacity); }
258
}
259
260
.osd & {
261
}
262
}
263
264
265
/***********
266
* Buttons *
267
***********/
268
269
// stuff for .needs-attention
270
@keyframes needs_attention {
271
from {
272
background-image: -gtk-gradient(radial,
273
center center, 0,
274
center center, 0.001,
275
to($accent_bg_color),
276
to(transparent));
277
}
278
to {
279
background-image: -gtk-gradient(radial,
280
center center, 0,
281
center center, 0.5,
282
to($accent_bg_color),
283
to(transparent));
284
}
285
}
286
287
288
.button {
289
padding: 7px 10px 8px;
290
border-radius: 2px;
291
background-repeat: no-repeat;
292
background-position: center, center;
293
background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto;
294
font-weight: 500;
295
@include button(normal);
296
&:hover { @include button(hover); }
297
&:active { @include button(active); }
298
&:insensitive { @include button(insensitive); }
299
&:checked { @include button(checked); }
300
&:checked:insensitive { @include button(checked-insensitive); }
301
&.flat {
302
@include button(flat-normal);
303
&:hover { @include button(flat-hover); }
304
&:active { @include button(flat-active); }
305
&:insensitive { @include button(flat-insensitive); }
306
&:checked { @include button(flat-checked); }
307
&:checked:insensitive { @include button(flat-checked-insensitive); }
308
.linked > & {
309
border-radius: 2px;
310
&.image-button {
311
outline-radius: 100px;
312
border-radius: 100px;
313
}
314
}
315
}
316
// big standalone buttons like in Documents pager
317
&.osd {
318
&.image-button {
319
padding: 16px;
320
background-size: ($large_size / 0.8) ($large_size / 0.8), auto;
321
}
322
&:insensitive { opacity: 0; }
323
}
324
//overlay / OSD style
325
.osd & {
326
}
327
328
// Suggested and Destructive Action buttons
329
@each $b_type, $b_color in (suggested-action, $suggested_color),
330
(destructive-action, $destructive_color) {
331
&.#{$b_type} {
332
background-color: $b_color;
333
color: $selected_fg_color;
334
// @include button(normal, $b_color, white);
335
// &:hover { @include button(hover, $b_color, white); }
336
// &:active, &:checked { @include button(active, $b_color, white); }
337
&:insensitive { @include button(insensitive, $b_color, white); }
338
&:checked { background-color: mix($selected_fg_color, $b_color, percentage($lower_opacity)); }
339
&.flat {
340
background-color: transparent;
341
color: $b_color;
342
// @include button(flat-normal, $b_color, white);
343
// &:hover { @include button(flat-hover, $b_color, white); }
344
// &:active, &:checked { @include button(flat-active, $b_color, white); }
345
&:insensitive { @include button(flat-insensitive, $b_color, white); }
346
}
347
}
348
}
349
350
&.image-button { @extend %image_button; }
351
352
&.text-button {
353
padding-left: 16px;
354
padding-right: 16px;
355
}
356
357
&.text-button.image-button {
358
// those buttons needs uneven horizontal padding, we want the icon side
359
// to have the image-button padding, while the text side the text-button
360
// one, so we're adding the missing padding to the label depending on
361
// its position inside the button
362
padding: 7px 10px 8px; // same as .button
363
outline-radius: 2px;
364
border-radius: 2px;
365
background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto;
366
.label:first-child { padding-left: 6px; }
367
.label:last-child { padding-right: 6px; }
368
}
369
370
.stack-switcher > & {
371
// to position the needs attention dot, padding is added to the button
372
// child, a label needs just lateral padding while an icon needs vertical
373
// padding added too.
374
375
outline-offset: -4px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
376
377
> .label {
378
padding-left: 6px; // label padding
379
padding-right: 6px; //
380
}
381
> GtkImage {
382
padding-left: 6px; // image padding
383
padding-right: 6px; //
384
padding-top: 3px; //
385
padding-bottom: 3px; //
386
}
387
&.text-button {
388
padding: 7px 10px 8px; // needed or it will get overridden
389
}
390
&.image-button {
391
// we want image buttons to have a 1:1 aspect ratio, so compensation
392
// of the padding added to the GtkImage is needed
393
padding: 7px 4px;
394
}
395
&.needs-attention > .label,
396
&.needs-attention > GtkImage { @extend %needs_attention; }
397
&.needs-attention:checked > .label,
398
&.needs-attention:checked > GtkImage {
399
animation: none;
400
background-image: none;
401
}
402
}
403
404
//inline-toolbar buttons
405
.inline-toolbar & {
406
@extend .button.flat;
407
@extend %image_button;
408
}
409
410
.primary-toolbar & { icon-shadow: none; } // tango icons don't need shadows
411
412
.linked > &:not(.flat):not(:only-child) { @extend %linked; }
413
414
.linked.vertical > &:not(.flat):not(:only-child) { @extend %linked_vertical; }
415
}
416
417
%image_button {
418
padding: 10px;
419
outline-radius: 100px;
420
border-radius: 100px;
421
background-size: ($medium_size / 0.8) ($medium_size / 0.8), auto;
422
}
423
424
%needs_attention {
425
transition: none;
426
animation: needs_attention $material_duration $material_timing_function forwards;
427
background-repeat: no-repeat;
428
background-position: right 3px;
429
background-size: 6px 6px;
430
&:dir(rtl) { background-position: left 3px; }
431
}
432
433
434
// all the following is for the +|- buttons on inline toolbars, that way
435
// should really be deprecated...
436
.inline-toolbar GtkToolButton > .button { // redefining the button look is
437
// needed since those are flat...
438
}
439
440
// More inline toolbar buttons
441
.inline-toolbar.toolbar GtkToolButton {
442
// & > .button.flat { @extend %linked_middle; }
443
// &:first-child > .button.flat { @extend %linked:first-child; }
444
// &:last-child > .button.flat { @extend %linked:last-child; }
445
// &:only-child > .button.flat { @extend %linked:only-child; }
446
}
447
448
%linked_middle {
449
border-radius: 0;
450
}
451
452
%linked {
453
outline-radius: 2px;
454
@extend %linked_middle;
455
&:first-child {
456
border-top-left-radius: 2px;
457
border-bottom-left-radius: 2px;
458
}
459
&:last-child {
460
border-top-right-radius: 2px;
461
border-bottom-right-radius: 2px;
462
}
463
&:only-child {
464
border-radius: 2px;
465
}
466
}
467
468
%linked_vertical_middle {
469
border-radius: 0;
470
}
471
472
%linked_vertical{
473
outline-radius: 2px;
474
@extend %linked_vertical_middle;
475
&:first-child {
476
border-top-left-radius: 2px;
477
border-top-right-radius: 2px;
478
}
479
&:last-child {
480
border-bottom-left-radius: 2px;
481
border-bottom-right-radius: 2px;
482
}
483
&:only-child {
484
border-radius: 2px;
485
}
486
}
487
488
/* menu buttons */
489
.menuitem.button.flat {
490
&:selected { @extend %selected_items; }
491
}
492
493
494
GtkColorButton.button {
495
padding: 7px 8px 8px; // Uniform padding on the GtkColorButton
496
497
GtkColorSwatch:first-child:last-child { // :first-child:last-child for a specificity bump, it gets overridden by the
498
// colorpicker style, otherwise
499
border-radius: 2px;
500
box-shadow: $z-depth-1;
501
}
502
}
503
504
/*********
505
* Links *
506
*********/
507
508
*:link {
509
color: $link_color;
510
&:hover, &:active { color: $link_color; }
511
&:visited {
512
color: $link_visited_color;
513
&:hover, &:active { color: $link_visited_color; }
514
*:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
515
}
516
&:selected, *:selected & {
517
color: mix($selected_fg_color, $selected_bg_color, 80%);
518
}
519
}
520
521
.button:link, .button:visited {
522
@extend *:link;
523
& > .label {
524
text-decoration-line: underline;
525
}
526
}
527
528
/*****************
529
* GtkSpinButton *
530
*****************/
531
532
.spinbutton {
533
.button {
534
padding: 4px;
535
border: solid $container_padding transparent;
536
@extend %image_button;
537
// @extend .button.flat;
538
@include button(flat-normal);
539
&:hover { @include button(flat-hover); }
540
&:active { @include button(flat-active); }
541
&:insensitive { @include button(flat-insensitive); }
542
}
543
.osd & {
544
.button {
545
}
546
}
547
&.vertical { //FIXME: try using linking templates for vertically linked stuff
548
.button {
549
padding-top: 10px; // Same vertical padding as image-buttons
550
padding-bottom: 10px; //
551
border: none;
552
&:first-child {
553
border-radius: 2px 2px 0 0;
554
}
555
&:last-child {
556
border-radius: 0 0 2px 2px;
557
}
558
}
559
&.entry {
560
}
561
}
562
GtkTreeView & {
563
&.entry, &.entry:focus {
564
// padding: 1px;
565
// border-width: 1px 0;
566
// border-color: $selected_bg_color;
567
// border-radius: 0;
568
// box-shadow: none;
569
}
570
}
571
}
572
573
/**************
574
* ComboBoxes *
575
**************/
576
GtkComboBox {
577
> .the-button-in-the-combobox { padding: 5px 6px 6px; } // Otherwise combos
578
// are bigger then
579
// buttons
580
-GtkComboBox-arrow-scaling: 0.5;
581
-GtkComboBox-shadow-type: none;
582
583
.menu .menuitem { padding: 5px 6px 6px; }
584
.separator.vertical {
585
// always disable separators
586
-GtkWidget-wide-separators: true;
587
}
588
&.combobox-entry .entry {
589
&:dir(ltr) {
590
border-top-right-radius: 0;
591
border-bottom-right-radius: 0;
592
}
593
&:dir(rtl) {
594
border-top-left-radius: 0;
595
border-bottom-left-radius: 0;
596
}
597
}
598
&.combobox-entry .button {
599
padding: 10px;
600
&:dir(ltr) {
601
border-top-left-radius: 0;
602
border-bottom-left-radius: 0;
603
}
604
&:dir(rtl) {
605
border-top-right-radius: 0;
606
border-bottom-right-radius: 0;
607
}
608
}
609
}
610
611
.linked > GtkComboBox > .the-button-in-the-combobox,
612
.linked > GtkComboBoxText > .the-button-in-the-combobox {
613
// the combo is a composite widget so the way we do button linkind doesn't
614
// work, special case needed. See
615
// https://bugzilla.gnome.org/show_bug.cgi?id=733979
616
&:dir(ltr),
617
&:dir(rtl) { @extend %linked_middle; } // specificity bump
618
}
619
.linked > GtkComboBox:first-child > .the-button-in-the-combobox,
620
.linked > GtkComboBoxText:first-child > .the-button-in-the-combobox {
621
@extend %linked:first-child;
622
}
623
.linked > GtkComboBox:last-child > .the-button-in-the-combobox,
624
.linked > GtkComboBoxText:last-child > .the-button-in-the-combobox {
625
@extend %linked:last-child;
626
}
627
.linked > GtkComboBox:only-child > .the-button-in-the-combobox,
628
.linked > GtkComboBoxText:only-child > .the-button-in-the-combobox {
629
@extend %linked:only-child;
630
}
631
632
.linked.vertical > GtkComboBoxText > .the-button-in-the-combobox,
633
.linked.vertical > GtkComboBox > .the-button-in-the-combobox { @extend %linked_vertical_middle; }
634
.linked.vertical > GtkComboBoxText:first-child > .the-button-in-the-combobox,
635
.linked.vertical > GtkComboBox:first-child > .the-button-in-the-combobox { @extend %linked_vertical:first-child; }
636
.linked.vertical > GtkComboBoxText:last-child > .the-button-in-the-combobox,
637
.linked.vertical > GtkComboBox:last-child > .the-button-in-the-combobox { @extend %linked_vertical:last-child; }
638
.linked.vertical > GtkComboBoxText:only-child > .the-button-in-the-combobox,
639
.linked.vertical > GtkComboBox:only-child > .the-button-in-the-combobox { @extend %linked_vertical:only-child; }
640
641
/************
642
* Toolbars *
643
************/
644
.toolbar {
645
-GtkWidget-window-dragging: true;
646
padding: 4px;
647
background-color: $bg_color;
648
.osd &, &.osd {
649
padding: $container_padding;
650
border-style: solid;
651
border-width: 8px;
652
border-image: -gtk-scaled(url("assets/osd-shadow#{$asset_suffix}.png"),
653
url("assets/osd-shadow#{$asset_suffix}@2.png"))
654
10 / 10px stretch;
655
border-radius: 2px;
656
// box-shadow: $z-depth-2;
657
background-color: $base_color;
658
&:backdrop {
659
border-image: -gtk-scaled(url("assets/osd-shadow-backdrop#{$asset_suffix}.png"),
660
url("assets/osd-shadow-backdrop#{$asset_suffix}@2.png"))
661
10 / 10px stretch;
662
// box-shadow: $z-depth-1;
663
}
664
& .button {
665
@extend .button.flat;
666
}
667
}
668
}
669
670
//searchbar, location-bar & inline-toolbar
671
.inline-toolbar {
672
padding: $container_padding;
673
border-style: solid;
674
border-width: 0 1px 1px;
675
border-color: $borders_color;
676
background-color: $secondary_base_color;
677
}
678
679
.search-bar, .location-bar {
680
padding: $container_padding;
681
border-style: solid;
682
border-width: 0 0 1px;
683
border-color: $borders_color;
684
background-color: $dark_color;
685
background-clip: border-box;
686
}
687
688
/***************
689
* Header bars *
690
***************/
691
692
.titlebar,
693
.header-bar {
694
padding: $container_padding;
695
border-width: 0 0 1px;
696
border-style: solid;
697
border-color: $borders_color;
698
border-radius: 2px 2px 0 0;
699
box-shadow: inset 0 1px $highlight_color;
700
background-color: $dark_color;
701
background-clip: border-box;
702
703
&:backdrop {
704
// background-color: $dark_color;
705
}
706
707
.title {
708
padding-left: 12px;
709
padding-right: 12px;
710
font-weight: bold;
711
}
712
713
.subtitle {
714
@extend .dim-label;
715
padding-left: 12px;
716
padding-right: 12px;
717
font-size: smaller;
718
}
719
720
.header-bar-separator,
721
& > GtkBox > .separator.vertical {
722
-GtkWidget-wide-separators: true;
723
-GtkWidget-separator-width: 1px;
724
border-style: solid;
725
border-width: 0 1px;
726
border-color: $borders_color;
727
}
728
729
& .button:not(.suggested-action):not(.destructive-action) {
730
@extend .button.flat;
731
border-image: -gtk-gradient(radial,
732
center bottom, 0,
733
center bottom, 0.001,
734
to($selected_bg_color),
735
to(transparent))
736
0 0 0 / 0 0 0px;
737
&:checked {
738
border-image: -gtk-gradient(radial,
739
center bottom, 0,
740
center bottom, 0.5,
741
to($selected_bg_color),
742
to(transparent))
743
0 0 2 / 0 0 2px;
744
background-color: transparent;
745
color: $fg_color;
746
&:insensitive {
747
background-color: transparent;
748
color: $insensitive_fg_color;
749
> .label { color: inherit; }
750
}
751
}
752
}
753
754
&.selection-mode {
755
box-shadow: inset 0 1px $secondary_highlight_color;
756
background-color: $selected_bg_color;
757
color: $selected_fg_color;
758
&:backdrop {
759
}
760
761
.subtitle:link { @extend *:link:selected; }
762
763
.button {
764
border-image: -gtk-gradient(radial,
765
center bottom, 0,
766
center bottom, 0.001,
767
to($selected_fg_color),
768
to(transparent))
769
0 0 0 / 0 0 0px;
770
color: $secondary_selected_fg_color;
771
&:hover, &:active, &:checked {
772
color: $selected_fg_color;
773
}
774
775
&:insensitive {
776
}
777
778
&:checked {
779
border-image: -gtk-gradient(radial,
780
center bottom, 0,
781
center bottom, 0.5,
782
to($selected_fg_color),
783
to(transparent))
784
0 0 2 / 0 0 2px;
785
color: $selected_fg_color;
786
&:insensitive {
787
color: $insensitive_selected_fg_color;
788
> .label { color: inherit; }
789
}
790
}
791
&.suggested-action {
792
// NOTE: do not use @extend .button;
793
@include button(normal);
794
&:hover { @include button(hover); }
795
&:active { @include button(active); }
796
&:insensitive { @include button(insensitive); }
797
}
798
}
799
800
.selection-menu {
801
padding-left: 16px;
802
padding-right: 16px;
803
804
GtkArrow { -GtkArrow-arrow-scaling: 1; }
805
806
.arrow {
807
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
808
}
809
}
810
}
811
812
.tiled &, .maximized & {
813
border-radius: 0; // squared corners when the window is max'd or tiled
814
box-shadow: none;
815
}
816
817
&.default-decoration {
818
padding: $container_padding;
819
border-width: 0;
820
.button { padding: 4px; }
821
}
822
}
823
824
/************
825
* Pathbars *
826
************/
827
828
.path-bar .button {
829
padding: 7px 6px 8px;
830
&.image-button { padding: 10px; }
831
&:only-child {
832
padding-left: 16px;
833
padding-right: 16px;
834
}
835
836
// the following is for spacing the icon and the label inside the home button
837
.label:last-child { padding-left: 2px; }
838
.label:first-child { padding-right: 2px; }
839
.label:only-child { padding-right: 0; padding-left: 0; }
840
GtkImage { padding-top: 1px; }
841
}
842
843
/**************
844
* Tree Views *
845
**************/
846
GtkTreeView.view {
847
-GtkTreeView-grid-line-width: 1;
848
-GtkTreeView-grid-line-pattern: '';
849
-GtkTreeView-tree-line-width: 1;
850
-GtkTreeView-tree-line-pattern: '';
851
-GtkTreeView-expander-size: 16;
852
853
border-left-color: $track_color; // this is actually the tree lines color,
854
border-top-color: $borders_color; // while this is the grid lines color, better then nothing
855
856
&.rubberband { @extend .rubberband; } // to avoid borders being overridden by the previously set props
857
858
border-radius: 0; // rest border radius in lists
859
860
&:hover, &:active, &:selected { border-radius: 0; }
861
862
&.dnd {
863
border-style: solid none;
864
border-width: 1px;
865
border-color: mix($fg_color, $selected_bg_color, 50%);
866
}
867
868
&.expander {
869
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
870
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
871
&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
872
&:selected {
873
color: scale-alpha($selected_fg_color, $enabled_opacity);
874
&:hover, &:active { color: $selected_fg_color; }
875
}
876
}
877
878
&.progressbar { // progress bar in treeviews
879
@extend .entry.progressbar;
880
border-width: 4px;
881
&:selected {
882
border-color: currentColor;
883
}
884
}
885
886
&.trough { // progress bar trough in treeviews
887
@extend .entry.progressbar;
888
border-width: 4px;
889
border-color: scale-alpha($selected_bg_color, $lower_opacity);
890
&:selected {
891
border-color: $track_color;
892
}
893
}
894
}
895
896
column-header {
897
.button {
898
@extend .list-row.activatable;
899
padding: 3px 6px 4px;
900
border-style: none solid solid none;
901
border-width: 1px;
902
border-color: $borders_color;
903
border-radius: 0;
904
box-shadow: none;
905
background-color: $base_color;
906
// font-weight: bold;
907
&:hover, &:active {
908
box-shadow: none;
909
}
910
&:insensitive {
911
background-color: $base_color;
912
}
913
&.dnd {
914
@extend column-header.button.dnd;
915
}
916
}
917
&:last-child .button,
918
&:last-child.button { //treeview-like derived widgets in Banshee and Evolution
919
border-right-style: none;
920
}
921
}
922
923
column-header.button.dnd { // for treeview-like derive widgets
924
border-left-style: solid;
925
background-clip: $extra_background_clip;
926
color: $selected_bg_color;
927
}
928
929
930
/*********
931
* Menus *
932
*********/
933
.menubar {
934
-GtkWidget-window-dragging: true;
935
padding: 0px;
936
box-shadow: inset 0 -1px $borders_color;
937
background-color: $dark_color;
938
& > .menuitem {
939
padding: 4px 8px;
940
color: $secondary_fg_color;
941
&:hover { //Seems like it :hover even with keyboard focus
942
box-shadow: inset 0 -2px $selected_bg_color;
943
color: $fg_color;
944
}
945
&:insensitive {
946
color: $insensitive_fg_color;
947
box-shadow: none;
948
}
949
}
950
}
951
952
.menu {
953
margin: 4px;
954
padding: 0px;
955
background-color: $base_color;
956
border: 1px solid $borders_color; // adds borders in a non composited env
957
.csd & { border: none; } // axes borders in a composited env
958
.menuitem {
959
transition: none;
960
padding: 3px 4px 4px;
961
font: initial;
962
text-shadow: none;
963
&:hover {
964
color: $selected_fg_color;
965
background-color: $selected_bg_color;
966
}
967
&:insensitive {
968
color: $insensitive_fg_color;
969
}
970
//submenu indicators
971
&.arrow { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
972
&.arrow:dir(rtl) {-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); }
973
}
974
&.button { // overlow buttons
975
border-style: none;
976
border-radius: 0;
977
&.top { border-bottom: 1px solid $borders_color; }
978
&.bottom { border-top: 1px solid $borders_color; }
979
&:hover { background-color: $track_color; }
980
&:insensitive {
981
color: transparent;
982
background-color: transparent;
983
border-color: transparent;
984
}
985
}
986
}
987
988
.menuitem .accelerator { color: gtkalpha(currentColor, $hint_opacity); }
989
990
991
/***************
992
* Popovers *
993
***************/
994
995
.popover {
996
padding: 2px;
997
border: 1px solid;
998
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3);
999
border-radius: 2px + 1px;
1000
background-color: $secondary_base_color;
1001
box-shadow: $z-depth-2;
1002
&:backdrop { box-shadow: $z-depth-1; }
1003
1004
> .list,
1005
> .view,
1006
> .toolbar,
1007
&.osd > .toolbar {
1008
border-style: none;
1009
border-image: none;
1010
background-color: transparent;
1011
}
1012
1013
.button.flat {
1014
padding: 5px 8px 6px;
1015
background-color: transparent;
1016
background-size: (128px / 0.8) (128px / 0.8), auto;
1017
color: $fg_color;
1018
font: initial;
1019
}
1020
1021
.linked > .button {
1022
border-radius: 2px;
1023
// @extend .button.flat;
1024
@include button(flat-normal);
1025
&:hover { @include button(flat-hover); }
1026
&:active { @include button(flat-active); }
1027
&:insensitive { @include button(flat-insensitive); }
1028
&:checked { @include button(checked); }
1029
&:checked:insensitive { @include button(checked-insensitive); }
1030
&.image-button { background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto; }
1031
}
1032
1033
&.osd { @extend %osd; }
1034
}
1035
1036
/*****************
1037
* Notebooks and *
1038
* Tabs *
1039
*****************/
1040
1041
.notebook {
1042
// Through me you go to the grief wracked city;
1043
// Through me you go to everlasting pain;
1044
// Through me you go a pass among lost souls.
1045
// ...
1046
// Abandon all hope — Ye Who Enter Here
1047
padding: 0;
1048
background-color: $base_color;
1049
-GtkNotebook-initial-gap: 6;
1050
-GtkNotebook-arrow-spacing: 5;
1051
-GtkNotebook-tab-curvature: 0;
1052
-GtkNotebook-tab-overlap: 1;
1053
-GtkNotebook-has-tab-gap: false;
1054
-GtkWidget-focus-padding: 0;
1055
-GtkWidget-focus-line-width: 0;
1056
&.frame {
1057
border: 1px solid $borders_color;
1058
// FIXME doesn't work
1059
&.top { border-top-width: 0; }
1060
&.bottom { border-bottom-width: 0; }
1061
&.right { border-right-width: 0; }
1062
&.left { border-left-width: 0; }
1063
}
1064
&.header {
1065
// FIXME: double borders in some case, can't fix it w/o a class tho
1066
// FIXME: doesn't work on dark var
1067
background-color: $dark_color;
1068
1069
// this is the shading of the header behind the tabs
1070
&.frame {
1071
border: 1px solid $borders_color;
1072
&.top { border-bottom-width: 0; }
1073
&.bottom { border-top-width: 0; }
1074
&.right { border-left-width: 0; }
1075
&.left { border-right-width: 0; }
1076
}
1077
1078
&.top {
1079
box-shadow: inset 0 -1px $borders_color; // border
1080
}
1081
&.bottom {
1082
box-shadow: inset 0 1px $borders_color;
1083
}
1084
&.right {
1085
box-shadow: inset 1px 0 $borders_color;
1086
}
1087
&.left {
1088
box-shadow: inset -1px 0 $borders_color;
1089
}
1090
}
1091
tab {
1092
border-width: 0;
1093
border-style: solid;
1094
border-color: transparent;
1095
background-color: transparent;
1096
1097
outline-offset: 0;
1098
1099
$tab_indicator_size: 2px;
1100
// vertical tab sizing
1101
$vt_vpadding: 8px;
1102
$vt_hpadding: 20px;
1103
// horizontal tab sizing
1104
$ht_vpadding: 5px;
1105
$ht_hpadding: 20px;
1106
1107
//FIXME: we get double border in some cases, not considering the broken
1108
//notebook content frame...
1109
&.top, &.bottom { padding: $vt_vpadding $vt_hpadding; }
1110
&.left, &.right { padding: $ht_vpadding $ht_hpadding; }
1111
1112
1113
/* works for testnotebookdnd, but there's a superfluous border
1114
in gedit or web, commented out for now, needs gtk fixes
1115
&.reorderable-page {
1116
&.top {
1117
padding-top: ($vt_vpadding - 1px);
1118
border-top-width: 1px;
1119
border-left-width: 1px;
1120
border-right-width: 1px;
1121
}
1122
&.bottom {
1123
padding-bottom: ($vt_vpadding - 1px);
1124
border-bottom-width: 1px;
1125
border-left-width: 1px;
1126
border-right-width: 1px;
1127
}
1128
&.left {
1129
padding-left: ($ht_hpadding - 1px);
1130
border-left-width: 1px;
1131
border-top-width: 1px;
1132
border-bottom-width: 1px;
1133
}
1134
&.right {
1135
padding-right: ($ht_hpadding - 1px);
1136
border-right-width: 1px;
1137
border-top-width: 1px;
1138
border-bottom-width: 1px;
1139
}
1140
}
1141
*/
1142
&.reorderable-page {
1143
-GtkNotebook-tab-overlap: 1;
1144
&.top, &.bottom {
1145
padding-left: 12px; // for a nicer close button
1146
padding-right: 12px; // placement
1147
border-left-width: 1px;
1148
border-right-width: 1px;
1149
}
1150
&.left, &.right {
1151
border-bottom-width: 1px;
1152
border-top-width: 1px;
1153
}
1154
}
1155
&.top {
1156
// padding-bottom: ($vt_vpadding -$tab_indicator_size);
1157
border-bottom-width: $tab_indicator_size;
1158
}
1159
&.bottom {
1160
// padding-top: ($vt_vpadding -$tab_indicator_size);
1161
border-top-width: $tab_indicator_size;
1162
}
1163
&.left {
1164
// padding-right: ($ht_hpadding -$tab_indicator_size);
1165
border-right-width: $tab_indicator_size;
1166
}
1167
&.right {
1168
// padding-left: ($ht_hpadding -$tab_indicator_size);
1169
border-left-width: $tab_indicator_size;
1170
}
1171
1172
//here's the interesting stuff
1173
&:hover, &.prelight-page {
1174
border-color: $track_color;
1175
}
1176
&:active, &.active-page {
1177
border-color: $selected_bg_color;
1178
}
1179
@each $_tab, $_border in (top, bottom),
1180
(bottom, top),
1181
(left, right),
1182
(right, left) {
1183
&.reorderable-page.#{$_tab} {
1184
border-color: transparent;
1185
&:hover, &.prelight-page {
1186
border-color: $borders_color;
1187
border-#{$_border}-width: 1px;
1188
border-#{$_border}-color: transparent;
1189
background-color: $bg_color;
1190
}
1191
&:active, &.active-page {
1192
border-color: $borders_color;
1193
border-#{$_border}-width: 1px;
1194
border-#{$_border}-color: transparent;
1195
background-color: $light_color;
1196
}
1197
}
1198
}
1199
.label { //tab text
1200
padding: 0 2px; // needed for a nicer focus ring
1201
font-weight: bold;
1202
color: $secondary_fg_color;
1203
}
1204
.prelight-page .label, .label.prelight-page {
1205
// prelight tab text
1206
color: $fg_color;
1207
}
1208
.active-page .label, .label.active-page {
1209
// active tab text
1210
color: $fg_color;
1211
}
1212
.button { //tab close button
1213
padding: 0;
1214
@extend %image_button;
1215
background-size: ($small_size / 0.8) ($small_size / 0.8), auto;
1216
// @extend .button.flat;
1217
@include button(flat-normal);
1218
&:hover { @include button(flat-hover); }
1219
&:active { @include button(flat-active); }
1220
&:insensitive { @include button(flat-insensitive); }
1221
& > GtkImage { // this is a hack which makes tabs grow
1222
padding: 4px;
1223
}
1224
}
1225
}
1226
&.arrow {
1227
&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); }
1228
&:insensitive {
1229
color: $insensitive_fg_color;
1230
}
1231
}
1232
&:not(.reorderable-page) > .entry {
1233
@extend .entry.flat;
1234
}
1235
}
1236
1237
/**************
1238
* Scrollbars *
1239
**************/
1240
1241
$_slider_margin: 4px;
1242
$_slider_fine_tune_margin: 6px;
1243
1244
.scrollbar {
1245
-GtkRange-slider-width: 8 + $_slider_margin * 2 + 1;
1246
-GtkRange-trough-border: 0;
1247
-GtkScrollbar-has-backward-stepper: false;
1248
-GtkScrollbar-has-forward-stepper: false;
1249
-GtkScrollbar-min-slider-length: 24 + $_slider_margin * 2;
1250
// minimum size for the slider.
1251
// sadly can't be in '.slider'
1252
// where it belongs
1253
-GtkRange-stepper-spacing: 0;
1254
-GtkRange-trough-under-steppers: 1;
1255
1256
.button {
1257
border: none;
1258
}
1259
1260
&.overlay-indicator {
1261
&:not(.dragging):not(.hovering) { // Overlay scrolling indicator
1262
-GtkRange-slider-width: 4 + $_slider_margin * 2;
1263
1264
.slider {
1265
margin: $_slider_margin / 2;
1266
border: $_slider_margin / 2 solid scale-alpha($base_color, $lower_opacity);
1267
// background-clip: padding-box;
1268
}
1269
1270
.trough {
1271
border-style: none;
1272
background-color: transparent;
1273
}
1274
1275
}
1276
1277
&.dragging,
1278
&.hovering {
1279
.trough {
1280
background-color: scale-alpha($base_color, $higher_opacity);
1281
}
1282
}
1283
}
1284
1285
// trough coloring
1286
.trough {
1287
border: 1px none $borders_color;
1288
background-color: $base_color;
1289
background-clip: $extra_background_clip;
1290
}
1291
1292
// slider coloring
1293
.slider {
1294
background-color: $tertiary_fg_color;
1295
&:hover { background-color: $secondary_fg_color; }
1296
&:active { background-color: $fg_color; }
1297
&:insensitive {
1298
opacity: $disabled_opacity;
1299
}
1300
}
1301
1302
1303
// sizing
1304
.slider {
1305
border-radius: 100px;
1306
margin: $_slider_margin;
1307
}
1308
1309
&.fine-tune .slider { margin: $_slider_fine_tune_margin; }
1310
1311
&.vertical {
1312
1313
.slider {
1314
margin-left: 1px + $_slider_margin;
1315
1316
&:dir(rtl) {
1317
margin-left: $_slider_margin;
1318
margin-right: 1px + $_slider_margin;
1319
}
1320
}
1321
1322
&.fine-tune .slider {
1323
margin-left: 1px + $_slider_fine_tune_margin;
1324
1325
&:dir(rtl) {
1326
margin-left: $_slider_fine_tune_margin;
1327
margin-right: 1px + $_slider_fine_tune_margin;
1328
}
1329
}
1330
1331
.trough {
1332
border-left-style: solid;
1333
1334
&:dir(rtl) {
1335
border-left-style: none;
1336
border-right-style: solid;
1337
}
1338
}
1339
}
1340
1341
&.horizontal {
1342
1343
.slider { margin-top: 1px + $_slider_margin; }
1344
1345
&.fine-tune .slider { margin-top: 1px + $_slider_fine_tune_margin; }
1346
1347
.trough { border-top-style: solid; }
1348
}
1349
}
1350
1351
.scrollbars-junction,
1352
.scrollbars-junction.frame { // the small square between two scrollbars
1353
border-style: solid none none solid;
1354
background-color: $base_color;
1355
1356
&:dir(rtl) { border-style: solid solid none none; }
1357
}
1358
1359
1360
/**********
1361
* Switch *
1362
**********/
1363
1364
GtkSwitch {
1365
-GtkSwitch-slider-width: 28px; // 55px is the right value to make it as tall
1366
// as buttons, not doing that for now
1367
-GtkSwitch-slider-height: 28px;
1368
1369
outline-offset: -4px;
1370
outline-radius: 100px;
1371
font-size: 0;
1372
&.trough {
1373
// similar to the .scale
1374
border: 10px solid transparent;
1375
border-radius: 100px;
1376
background-color: $track_color;
1377
// background-clip: padding-box;
1378
&:insensitive {
1379
color: $insensitive_fg_color;
1380
}
1381
&:active {
1382
background-color: $accent_bg_color;
1383
&:insensitive {
1384
background-color: $track_color;
1385
color: $accent_bg_color;
1386
}
1387
}
1388
}
1389
&.slider {
1390
padding: 4px;
1391
border-radius: 100px;
1392
@include entry(normal);
1393
&:hover { @include entry(focus); }
1394
&:insensitive { @include entry(insensitive); }
1395
}
1396
.list-row:selected & {
1397
}
1398
1399
}
1400
1401
/*************************
1402
* Check and Radio items *
1403
*************************/
1404
1405
// draw regular check and radio items using our PNG assets
1406
// all assets are rendered from assets.svg. never add pngs directly
1407
1408
@each $w,$a in ('check', 'checkbox'),
1409
('radio','radio') {
1410
1411
//standard checks and radios
1412
@each $s,$as in ('','-unchecked'),
1413
(':active', '-unchecked-active'),
1414
(':insensitive','-unchecked-insensitive'),
1415
(':inconsistent', '-mixed'),
1416
(':inconsistent:active', '-mixed-active'),
1417
(':inconsistent:insensitive', '-mixed-insensitive'),
1418
(':checked', '-checked'),
1419
(':checked:active', '-checked-active'),
1420
(':checked:insensitive','-checked-insensitive') {
1421
.#{$w}#{$s} {
1422
-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}#{$asset_suffix}.png"),
1423
url("assets/#{$a}#{$as}#{$asset_suffix}@2.png"));
1424
icon-shadow: $z-depth-1;
1425
&:hover, &:active { icon-shadow: $z-depth-2; }
1426
&:insensitive { icon-shadow: none; }
1427
&.button.flat { }
1428
}
1429
}
1430
1431
//menu
1432
@each $s,$as in ('',''),
1433
// (':active', '-checked'),
1434
(':insensitive','-insensitive'),
1435
(':inconsistent', '-mixed'),
1436
// (':inconsistent:active', '-mixed'),
1437
(':inconsistent:insensitive', '-mixed-insensitive'),
1438
(':checked', '-checked'),
1439
// (':checked:active', '-checked'),
1440
(':checked:insensitive','-checked-insensitive') {
1441
.menu .menuitem.#{$w}#{$s} {
1442
// color: gtkalpha(currentColor, $hint_opacity);
1443
// -gtk-icon-source: -gtk-icontheme('#{$a}-symbolic');
1444
// &:active, &:checked { -gtk-icon-source: -gtk-icontheme('#{$a}-checked-symbolic'); }
1445
// &:inconsistent { -gtk-icon-source: -gtk-icontheme('#{$a}-mixed-symbolic'); }
1446
-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}.png"),
1447
url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}@2.png"));
1448
icon-shadow: none;
1449
&:hover {
1450
-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic-dark.png"),
1451
url("assets/#{$a}#{$as}-symbolic-dark@2.png"));
1452
}
1453
}
1454
}
1455
}
1456
1457
//treeview and list-rows
1458
.view.check, .view.radio,
1459
.list-row .check, list-row .radio {
1460
}
1461
1462
//selection-mode
1463
@each $s,$as in ('','-selectionmode'),
1464
(':active', '-active-selectionmode'),
1465
(':insensitive', '-insensitive-selectionmode'),
1466
(':checked', '-checked-selectionmode'),
1467
(':checked:active', '-checked-active-selectionmode'),
1468
(':insensitive:checked', '-checked-insensitive-selectionmode') {
1469
.view.content-view.check#{$s}:not(.list) {
1470
-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"),
1471
url("assets/checkbox#{$as}@2.png"));
1472
background-color: transparent;
1473
}
1474
}
1475
1476
GtkCheckButton.text-button, GtkRadioButton.text-button {
1477
// this is for a nice focus on check and radios text
1478
padding: 2px 4px;
1479
outline-offset: 0;
1480
&:insensitive,
1481
&:insensitive:active,
1482
&:insensitive:inconsistent {
1483
// set insensitive color, which is overriden otherwise
1484
// color: $insensitive_fg_color;
1485
}
1486
}
1487
1488
/************
1489
* GtkScale *
1490
************/
1491
.scale,
1492
.scale.scale-has-marks-above.scale-has-marks-below,
1493
.scale.vertical.scale-has-marks-above.scale-has-marks-below {
1494
// FIXME: rationalize
1495
-GtkScale-slider-length: 20;
1496
-GtkRange-slider-width: 20;
1497
-GtkRange-trough-border: 2;
1498
outline-offset: -8px;
1499
outline-radius: 100px;
1500
1501
&.fine-tune {
1502
&.slider { background-size: 80%; }
1503
}
1504
1505
&.slider {
1506
&:not(:hover):not(:active) { background-size: 80%; }
1507
// @include entry(normal);
1508
// border-radius: 50%;
1509
// background-color: $accent_bg_color;
1510
@each $s,$as in ('',''),
1511
// (':hover','-hover'),
1512
(':active','-active'),
1513
(':insensitive','-insensitive') {
1514
&.slider#{$s} {
1515
$_url: 'assets/slider#{$as}#{$asset_suffix}';
1516
border-style: none;
1517
border-radius: 0;
1518
background-color: transparent;
1519
background-image: -gtk-scaled(url('#{$_url}.png'),
1520
url('#{$_url}@2.png'));
1521
background-repeat: no-repeat;
1522
background-position: center;
1523
box-shadow: none;
1524
}
1525
}
1526
&:hover {
1527
// @include entry(focus);
1528
// border-radius: 50%; // needed for double marks scales
1529
}
1530
&:insensitive {
1531
// @include entry(insensitive);
1532
// border-radius: 50%; // overridden
1533
}
1534
//OSD sliders
1535
.osd & {
1536
}
1537
}
1538
&.trough {
1539
margin: 10px 12px;
1540
background-color: $track_color;
1541
&.highlight {
1542
background-color: $accent_bg_color;
1543
&:insensitive { background-color: $track_color; }
1544
}
1545
&:insensitive { color: $insensitive_fg_color; }
1546
&.vertical { margin: 12px 10px; }
1547
//OSD troughs
1548
.osd & {
1549
}
1550
}
1551
// marks color
1552
&.separator {
1553
color: $track_color;
1554
}
1555
// scales on selected list rows
1556
.list-row:selected & {
1557
}
1558
}
1559
1560
@each $d,$dn in ('', 'horz'),
1561
('.vertical', 'vert') {
1562
@each $w,$we in ('scale-has-marks-below','scale_marks_below'),
1563
('scale-has-marks-above','scale_marks_above') {
1564
.scale#{$d}.#{$w} {
1565
-GtkScale-slider-length: 20;
1566
-GtkRange-slider-width: 25;
1567
-GtkRange-trough-border: 2;
1568
1569
@extend %#{$we}_#{$dn};
1570
1571
@each $s,$as in ('',''),
1572
// (':hover','-hover'),
1573
(':active','-active'),
1574
(':insensitive','-insensitive') {
1575
&.slider#{$s} {
1576
$_url: 'assets/slider-#{$dn}-#{$w}#{$as}#{$asset_suffix}';
1577
border-style: none;
1578
border-radius: 0;
1579
background-color: transparent;
1580
background-image: -gtk-scaled(url('#{$_url}.png'),
1581
url('#{$_url}@2.png'));
1582
background-repeat: no-repeat;
1583
background-position: center;
1584
box-shadow: none;
1585
}
1586
}
1587
}
1588
}
1589
}
1590
1591
%scale_marks_above_horz {
1592
.trough { margin: 15px 12px 10px; }
1593
}
1594
%scale_marks_below_horz {
1595
.trough { margin: 10px 12px 15px; }
1596
}
1597
%scale_marks_above_vert {
1598
.trough { margin: 12px 10px 12px 15px; }
1599
}
1600
%scale_marks_below_vert {
1601
.trough { margin: 12px 15px 12px 10px; }
1602
}
1603
1604
/*****************
1605
* Progress bars *
1606
*****************/
1607
1608
GtkProgressBar {
1609
-GtkProgressBar-min-horizontal-bar-height: 4;
1610
-GtkProgressBar-min-vertical-bar-width: 4;
1611
padding: 0;
1612
font-size: smaller;
1613
color: $tertiary_fg_color;
1614
&.osd {
1615
-GtkProgressBar-xspacing: 0;
1616
-GtkProgressBar-yspacing: 0;
1617
-GtkProgressBar-min-horizontal-bar-height: 4;
1618
}
1619
&.trough { // background
1620
border-radius: 0;
1621
background-color: scale-alpha($selected_bg_color, $lower_opacity);
1622
&.osd {
1623
border-style: none;
1624
box-shadow: none;
1625
// background-color: transparent;
1626
}
1627
}
1628
}
1629
1630
// moving bit
1631
.progressbar {
1632
border-radius: 0;
1633
background-color: $selected_bg_color;
1634
&.left {
1635
border-top-left-radius: 0;
1636
border-bottom-left-radius: 0;
1637
}
1638
&.right {
1639
border-top-right-radius: 0;
1640
border-bottom-right-radius: 0;
1641
}
1642
&.left.right {
1643
box-shadow: none;
1644
}
1645
&.vertical {
1646
&.bottom {
1647
border-bottom-left-radius: 0;
1648
border-bottom-right-radius: 0;
1649
box-shadow: none;
1650
}
1651
&.top {
1652
border-top-left-radius: 0;
1653
border-top-right-radius: 0;
1654
}
1655
}
1656
&.osd {
1657
background-image: none;
1658
background-color: $selected_bg_color;
1659
border-style: none;
1660
border-radius: 0;
1661
}
1662
}
1663
1664
1665
/*************
1666
* Level Bar *
1667
*************/
1668
1669
.level-bar {
1670
box-shadow: $z-depth-1; // needs to be set here to avoid clipping
1671
-GtkLevelBar-min-block-width: 36;
1672
-GtkLevelBar-min-block-height: 4;
1673
&.vertical {
1674
-GtkLevelBar-min-block-width: 4;
1675
-GtkLevelBar-min-block-height: 36;
1676
}
1677
&.trough {
1678
padding: 2px;
1679
border-radius: 2px;
1680
@include entry(normal);
1681
&:insensitive { @include entry(insensitive); }
1682
&.indicator-discrete {
1683
&.horizontal { padding: 2px 1px; }
1684
&.vertical { padding: 1px 2px; }
1685
}
1686
}
1687
&.fill-block {
1688
// FIXME: it would be nice to set make fill blocks bigger, but we'd need
1689
// :nth-child working on discrete indicators
1690
background-color: $selected_bg_color;
1691
border-radius: 0;
1692
box-shadow: none;
1693
&.indicator-discrete {
1694
&.horizontal { margin: 0 1px; }
1695
&.vertical { margin: 1px 0; }
1696
}
1697
&.level-high {
1698
background-color: $success_color;
1699
}
1700
&.level-low {
1701
background-color: $warning_color;
1702
}
1703
&.empty-fill-block {
1704
background-color: $track_color;
1705
}
1706
}
1707
}
1708
1709
1710
/**********
1711
* Frames *
1712
**********/
1713
.frame {
1714
border: 1px solid $borders_color;
1715
&.flat { border-style: none; }
1716
padding: 0;
1717
&.action-bar {
1718
padding: $container_padding;
1719
border-width: 1px 0 0;
1720
}
1721
}
1722
1723
GtkScrolledWindow {
1724
GtkViewport.frame { // avoid double borders when viewport inside
1725
// scrolled window
1726
border-style: none;
1727
}
1728
}
1729
1730
//vbox and hbox separators
1731
.separator {
1732
// always disable separators
1733
// -GtkWidget-wide-separators: true;
1734
color: $borders_color;
1735
1736
// Font and File button separators
1737
GtkFileChooserButton &.vertical,
1738
GtkFontButton &.vertical {
1739
// always disable separators
1740
-GtkWidget-wide-separators: true;
1741
}
1742
}
1743
1744
/*********
1745
* Lists *
1746
*********/
1747
1748
.list {
1749
border-color: $borders_color;
1750
background-color: $base_color;
1751
}
1752
1753
.list-row,
1754
.grid-child {
1755
padding: 2px;
1756
}
1757
1758
.list-row.activatable {
1759
// let's take care of background colors
1760
background-image: -gtk-gradient(radial,
1761
center center, 0,
1762
center center, 0.5,
1763
to(gtkalpha(currentColor, 0)),
1764
to(transparent)),
1765
linear-gradient(to bottom, gtkalpha(currentColor, 0));
1766
background-repeat: no-repeat;
1767
background-position: center, center;
1768
background-size: (192px / 0.8) (192px / 0.8), auto;
1769
&:hover {
1770
background-image: -gtk-gradient(radial,
1771
center center, 0,
1772
center center, 0.5,
1773
to(gtkalpha(currentColor, 0)),
1774
to(transparent)),
1775
linear-gradient(to bottom, gtkalpha(currentColor, 0.05));
1776
}
1777
&:active {
1778
transition-property: opacity, border-color, border-image, box-shadow,
1779
background-color, text-shadow, icon-shadow; // Remove background-image
1780
animation: list_ripple_effect $material_duration $material_timing_function forwards;
1781
}
1782
}
1783
1784
.list-row:selected {
1785
@extend %selected_items;
1786
.button {
1787
&:insensitive { color: $insensitive_secondary_selected_fg_color; }
1788
&.flat {
1789
color: $secondary_selected_fg_color;
1790
&:hover, &:active { color: $selected_fg_color; }
1791
&:insensitive { color: $insensitive_secondary_selected_fg_color; }
1792
}
1793
}
1794
}
1795
1796
// transition
1797
.list-row {
1798
&:hover { transition-duration: 0; }
1799
}
1800
1801
1802
/*********************
1803
* App Notifications *
1804
*********************/
1805
1806
.app-notification,
1807
.app-notification.frame {
1808
@extend %osd;
1809
@extend .toolbar.osd;
1810
.button {
1811
}
1812
}
1813
1814
/*************
1815
* Expanders *
1816
*************/
1817
1818
.expander {
1819
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1820
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
1821
&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1822
&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); }
1823
&:selected { color: $selected_fg_color; }
1824
}
1825
1826
/************
1827
* Calendar *
1828
***********/
1829
GtkCalendar {
1830
border: 1px solid $borders_color;
1831
color: $fg_color;
1832
1833
&:selected {
1834
@extend .view:selected;
1835
}
1836
1837
&.header {
1838
border: 1px solid transparent;
1839
border-bottom-color: $borders_color;
1840
border-radius: 0;
1841
}
1842
1843
&.button {
1844
// @extend .button.flat;
1845
@include button(flat-normal);
1846
&:hover { @include button(flat-hover); }
1847
&:active { @include button(flat-active); }
1848
&:insensitive { @include button(flat-insensitive); }
1849
}
1850
1851
&:inconsistent { color: gtkalpha(currentColor, $hint_opacity); }
1852
&.highlight {
1853
font-size: smaller;
1854
color: gtkalpha(currentColor, $hint_opacity);
1855
}
1856
}
1857
1858
/***********
1859
* Dialogs *
1860
***********/
1861
1862
.message-dialog .dialog-action-area .button {
1863
padding: 8px;
1864
}
1865
1866
.message-dialog { // Message Dialog styling
1867
&.background { background-color: $light_color; }
1868
.titlebar {
1869
border-style: none;
1870
// box-shadow: inset 0 1px $highlight_color;
1871
background-color: $light_color;
1872
}
1873
&.csd { // rounded bottom border styling for csd version
1874
&.background {
1875
// bigger radius for better antialiasing
1876
border-bottom-left-radius: 2px;
1877
border-bottom-right-radius: 2px;
1878
}
1879
.dialog-action-area .button {
1880
@extend .button.flat;
1881
padding: 9px 16px 10px;
1882
border-top: 1px solid $borders_color;
1883
border-radius: 0;
1884
background-size: (192px / 0.8) (192px / 0.8), auto;
1885
// &:first-child{ border-bottom-left-radius: 2px; }
1886
// &:last-child { border-bottom-right-radius: 2px; }
1887
&:first-child{ border-radius: 0 0 0 2px; }
1888
&:last-child { border-radius: 0 0 2px 0; }
1889
}
1890
}
1891
}
1892
1893
GtkFileChooserDialog {
1894
.search-bar {
1895
// background-color: $base_color;
1896
// border-color: $bg_color;
1897
}
1898
.dialog-action-box {
1899
border-top: 1px solid $borders_color;
1900
}
1901
}
1902
1903
/***********
1904
* Sidebar *
1905
***********/
1906
1907
.sidebar {
1908
border: none;
1909
background-color: $secondary_base_color;
1910
1911
&:selected {
1912
@extend %selected_items;
1913
}
1914
}
1915
1916
GtkSidebarRow {
1917
// Needs overriding of the GtkListBoxRow padding
1918
&.list-row {
1919
padding: 0px;
1920
}
1921
// Using margins/padding directly in the SidebarRow
1922
// will make the animation of the new bookmark row jump
1923
.sidebar-revealer {
1924
padding: 4px 14px 4px 12px;
1925
}
1926
.sidebar-icon {
1927
opacity: $hint_opacity; // dim the device icons
1928
&:dir(ltr) { padding-right: 8px; }
1929
&:dir(rtl) { padding-left: 8px; }
1930
}
1931
.sidebar-label {
1932
&:dir(ltr) { padding-right: 2px; }
1933
&:dir(rtl) { padding-left: 2px; }
1934
}
1935
}
1936
1937
GtkPlacesSidebar.sidebar {
1938
// looks like the label doesn't get all the states so work around
1939
.list-row:selected:insensitive .label { @extend %selected_items:insensitive; }
1940
1941
.sidebar-placeholder-row {
1942
border: solid 1px $selected_bg_color;
1943
}
1944
1945
.sidebar-new-bookmark-row {
1946
color: $accent_bg_color;
1947
}
1948
1949
@at-root .sidebar-button.button { // @at-root needded to not change the specificity making button styling inheritance broken
1950
// so istead of "GtkPlacesSidebar.sidebar .sidebar-button.button" [specificity 0,0,3,1]
1951
// the extended selector ".sidebar-button.button" [specificity 0,0,2,0]
1952
1953
&.image-button { padding: 4px; }
1954
1955
@extend .button.flat;
1956
}
1957
// this is for indicating which sidebar row generated a popover
1958
// see https://bugzilla.gnome.org/show_bug.cgi?id=754411
1959
.has-open-popup { @extend .list-row.activatable:active; }
1960
}
1961
1962
.sidebar-item {
1963
padding: 10px 4px;
1964
> .label {
1965
padding-left: 6px;
1966
padding-right: 6px;
1967
}
1968
&.needs-attention > .label {
1969
@extend %needs_attention;
1970
}
1971
}
1972
1973
/*********
1974
* Paned *
1975
*********/
1976
1977
GtkPaned { // this is for the standard paned separator
1978
1979
-GtkPaned-handle-size: 1; // sets separator width
1980
1981
-gtk-icon-source: none; // removes handle decoration
1982
margin: 0 8px 8px 0; // drag area of the separator, not a real margin
1983
&:dir(rtl) {
1984
margin-right: 0;
1985
margin-left: 8px;
1986
}
1987
.pane-separator {
1988
background-color: $borders_color;
1989
}
1990
}
1991
1992
GtkPaned.wide { // this is for the paned with wide separator
1993
-GtkPaned-handle-size: 6; // wider separator here
1994
margin: 0; // no need of the invisible drag area so, reset margin
1995
.pane-separator {
1996
background-color: transparent;
1997
border-style: none solid;
1998
border-color: $borders_color;
1999
border-width: 1px;
2000
}
2001
&.vertical .pane-separator { border-style: solid none;}
2002
}
2003
2004
2005
/**************
2006
* GtkInfoBar *
2007
**************/
2008
GtkInfoBar {
2009
border-style: none;
2010
}
2011
2012
.info {
2013
background-color: $info_bg_color;
2014
}
2015
2016
.question {
2017
background-color: $question_bg_color;
2018
}
2019
2020
.warning {
2021
background-color: $warning_bg_color;
2022
}
2023
2024
.error {
2025
background-color: $error_bg_color;
2026
}
2027
2028
.info,
2029
.question,
2030
.warning,
2031
.error {
2032
color: $selected_fg_color;
2033
.button {
2034
// @extend .list-row:selected.button;
2035
&:insensitive { color: $insensitive_secondary_selected_fg_color; }
2036
&.flat {
2037
color: $secondary_selected_fg_color;
2038
&:hover, &:active { color: $selected_fg_color; }
2039
&:insensitive { color: $insensitive_secondary_selected_fg_color; }
2040
}
2041
}
2042
.label:selected {
2043
}
2044
}
2045
2046
/************
2047
* Tooltips *
2048
************/
2049
2050
.tooltip {
2051
&.background {
2052
// background-color needs to be set this way otherwise it gets drawn twice
2053
// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
2054
background-color: scale-alpha($base_color, $higher_opacity);
2055
}
2056
2057
// @extend %osd;
2058
color: $fg_color;
2059
padding: 4px; /* not working */
2060
border-radius: 2px;
2061
box-shadow: none; // otherwise it gets inherited by windowframe.csd
2062
// FIXME: we need a border or tooltips vanish on black background.
2063
&.window-frame.csd {
2064
background-color: transparent;
2065
}
2066
}
2067
2068
.tooltip * { //Yeah this is ugly
2069
padding: 4px;
2070
background-color: transparent;
2071
color: inherit; // just to be sure
2072
}
2073
2074
/*****************
2075
* Color Chooser *
2076
*****************/
2077
2078
GtkColorSwatch {
2079
// This widget is made of two boxes one on top of the other, the lower box is GtkColorSwatch {} the other one
2080
// is GtkColorSwatch > .overlay {}, GtkColorSwatch has the programmatically set background, so most of the style
2081
// is applied to the overlay box.
2082
2083
box-shadow: $z-depth-1;
2084
2085
// we need to re-set the shadow here since it get axed by the previous bit
2086
&:selected { }
2087
2088
// base color corners rounding
2089
// to avoid the artifacts caused by rounded corner anti-aliasing the base color
2090
// sports a bigger radius.
2091
// nth-child is needed by the custom color strip.
2092
// The :not() madness is needed since actually the overlay is selectable by GtkColorSwatch > .overlay
2093
// and GtkColorSwatch.overlay, I know it's weird, but this is gtk+, not a browser.
2094
&.top {
2095
border-top-left-radius: 2px;
2096
border-top-right-radius: 2px;
2097
}
2098
&.bottom {
2099
border-bottom-left-radius: 2px;
2100
border-bottom-right-radius: 2px;
2101
}
2102
&.left, &:first-child:not(.overlay):not(.top) {
2103
border-top-left-radius: 2px;
2104
border-bottom-left-radius: 2px;
2105
}
2106
&.right, &:last-child:not(.overlay):not(.bottom) {
2107
border-top-right-radius: 2px;
2108
border-bottom-right-radius: 2px;
2109
}
2110
&:only-child:not(.overlay) { border-radius: 2px; }
2111
2112
// overlay corner rounding
2113
&.top > .overlay {
2114
border-top-left-radius: 2px;
2115
border-top-right-radius: 2px;
2116
}
2117
&.bottom > .overlay {
2118
border-bottom-left-radius: 2px;
2119
border-bottom-right-radius: 2px;
2120
}
2121
&:first-child:not(.top) > .overlay {
2122
border-top-left-radius: 2px;
2123
border-bottom-left-radius: 2px;
2124
}
2125
&:last-child:not(.bottom) > .overlay {
2126
border-top-right-radius: 2px;
2127
border-bottom-right-radius: 2px;
2128
}
2129
&:only-child > .overlay { border-radius: 2px; }
2130
2131
// hover effect
2132
&:hover { box-shadow: $z-depth-2; }
2133
2134
// no hover effect for the colorswatch in the color editor
2135
GtkColorEditor & {
2136
border-radius: 2px; // same radius as the entry
2137
&:hover { box-shadow: $z-depth-1; }
2138
}
2139
2140
// indicator and keynav outline colors
2141
&.color-dark {
2142
color: white;
2143
}
2144
&.color-light {
2145
color: scale-alpha(black, 0.8);
2146
}
2147
2148
// border color
2149
&.overlay,
2150
&.overlay:selected {
2151
}
2152
2153
// make the add color button looks like, well, a button
2154
&#add-color-button {
2155
background-image: linear-gradient(to right,
2156
$error_bg_color 25%,
2157
$warning_bg_color 25%, $warning_bg_color 50%,
2158
$info_bg_color 50%, $info_bg_color 75%,
2159
$question_bg_color 75%);
2160
color: white;
2161
}
2162
}
2163
2164
2165
/********
2166
* Misc *
2167
********/
2168
2169
//content view (grid/list)
2170
.content-view {
2171
background-color: $bg_color;
2172
// &:hover { -gtk-image-effect: highlight; }
2173
&.rubberband { @extend .rubberband; }
2174
}
2175
2176
.scale-popup {
2177
2178
.osd & { @extend %osd; }
2179
2180
.osd & .button.flat { //FIXME: quick hack, redo properly
2181
}
2182
2183
.button { // +/- buttons on GtkVolumeButton popup
2184
padding: 10px;
2185
}
2186
}
2187
2188
GtkScaleButton.button,
2189
GtkVolumeButton.button {
2190
// I assume both are image-button *by default*
2191
// with the image-button/text-button classes automagically applied depending on the button child these selectors can be deleted.
2192
@extend %image_button;
2193
2194
&.text-button { @extend .text-button }
2195
}
2196
2197
.floating-bar {
2198
@extend %osd;
2199
// @extend .toolbar.osd;
2200
padding: 3px 0 4px;
2201
border: 1px solid $borders_color;
2202
background-color: $base_color;
2203
background-clip: $extra_background_clip;
2204
}
2205
2206
.floating-bar.bottom.left { /* axes left border and border radius */
2207
border-width: 1px 1px 0 0;
2208
border-radius: 0 2px + 1px 0 0;
2209
// border-width: 8px 8px 0 0;
2210
// border-image-width: 10px 10px 0 0;
2211
}
2212
2213
.floating-bar.bottom.right { /* axes right border and border radius */
2214
border-width: 1px 0 0 1px;
2215
border-radius: 2px + 1px 0 0 0;
2216
// border-width: 8px 0 0 8px;
2217
// border-image-width: 10px 0 0 10px;
2218
}
2219
2220
/**********************
2221
* Window Decorations *
2222
*********************/
2223
2224
.window-frame {
2225
transition: none;
2226
border-radius: 2px 2px 0 0;
2227
box-shadow: $z-depth-4;
2228
2229
// FIXME rationalize window-frame shadows
2230
2231
/* this is used for the resize cursor area */
2232
margin: 8px;
2233
2234
&:backdrop {
2235
box-shadow: $z-depth-2;
2236
}
2237
&.tiled {
2238
border-radius: 0;
2239
}
2240
&.popup {
2241
box-shadow: none;
2242
}
2243
// server-side decorations as used by mutter
2244
&.ssd {
2245
box-shadow: 0 0 0 1px $borders_color; //just doing borders, wm draws actual shadows
2246
}
2247
&.csd {
2248
&.popup {
2249
border-radius: 0;
2250
box-shadow: $z-depth-2;
2251
}
2252
&.tooltip {
2253
border-radius: 2px;
2254
box-shadow: $z-depth-2;
2255
}
2256
&.message-dialog {
2257
border-radius: 2px;
2258
box-shadow: $z-depth-4;
2259
&:backdrop { box-shadow: $z-depth-2; }
2260
}
2261
}
2262
&.solid-csd {
2263
border-radius: 0;
2264
margin: 4px;
2265
background-color: $warning_color;
2266
border: solid 1px $borders_color;
2267
box-shadow: none;
2268
}
2269
}
2270
2271
// Window Close button
2272
.header-bar .button.titlebutton,
2273
.titlebar .button.titlebutton {
2274
// @extend .button.flat;
2275
@extend %image_button;
2276
}
2277
2278
// catch all extend :)
2279
2280
%selected_items {
2281
background-color: $selected_bg_color;
2282
color: $selected_fg_color;
2283
&:insensitive { color: $insensitive_selected_fg_color; }
2284
}
2285
2286
.monospace {
2287
font: Monospace;
2288
}
2289
2290
/**********************
2291
* Touch Copy & Paste *
2292
*********************/
2293
2294
//touch selection handlebars for the Popover.osd above
2295
.entry.cursor-handle,
2296
.cursor-handle {
2297
background-color: $accent_bg_color;
2298
background-image: none;
2299
box-shadow: none;
2300
border-style: none;
2301
@each $s,$as in ('',''),
2302
(':hover','-hover'),
2303
(':active','-active') { //no need for insensitive and backdrop
2304
&.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) {
2305
$_url: 'assets/text-select-start#{$as}#{$asset_suffix}';
2306
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
2307
url('#{$_url}@2.png'));
2308
padding-left: 10px;
2309
}
2310
&.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) {
2311
$_url: 'assets/text-select-end#{$as}#{$asset_suffix}';
2312
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
2313
url('#{$_url}@2.png'));
2314
padding-right: 10px;
2315
}
2316
&.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) {
2317
$_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}';
2318
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
2319
url('#{$_url}@2.png'));
2320
}
2321
}
2322
}
2323
2324
/* Decouple the font of context menus from their entry/textview */
2325
.context-menu {
2326
font: initial;
2327
}
2328
2329
.touch-selection {
2330
font: initial;
2331
color: $fg_color;
2332
background-color: $base_color;
2333
box-shadow: $z-depth-2;
2334
&:backdrop { box-shadow: $z-depth-1; }
2335
.button {
2336
}
2337
}
2338
2339
// This is used by GtkScrolledWindow, when content is touch-dragged past boundaries.
2340
// This draws a box on top of the content, the size changes programmatically.
2341
.overshoot {
2342
&.top {
2343
@include overshoot(top);
2344
}
2345
&.bottom {
2346
@include overshoot(bottom);
2347
}
2348
&.left {
2349
@include overshoot(left);
2350
}
2351
&.right {
2352
@include overshoot(right);
2353
}
2354
}
2355
2356
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
2357
.undershoot {
2358
&.top {
2359
@include undershoot(top);
2360
}
2361
2362
&.bottom {
2363
@include undershoot(bottom);
2364
}
2365
2366
&.left {
2367
@include undershoot(left);
2368
}
2369
2370
&.right {
2371
@include undershoot(right);
2372
}
2373
}
2374