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