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