_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 { 962transition: background-color $material_faster $material_ease_out, color $material_faster $material_ease_out; 963min-height: $large_size; 964padding: 0 $container_padding; 965box-shadow: $z-depth-1, inset 0 1px $secondary_highlight_color; 966background-color: $headerbar_color; 967color: $selected_fg_color; 968 969&:backdrop { 970color: $secondary_selected_fg_color; 971} 972 973.title { 974padding-left: 12px; 975padding-right: 12px; 976font-weight: bold; 977} 978 979.subtitle { 980padding-left: 12px; 981padding-right: 12px; 982font-size: smaller; 983 984@extend .dim-label; 985} 986 987button:not(.suggested-action):not(.destructive-action) { 988@extend %button_basic.flat; 989 990border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 991currentColor 0%, 992transparent 0%) 9930 0 0 / 0 0 0px; 994color: gtkalpha(currentColor, $enabled_opacity); 995 996&:hover, &:active { color: currentColor; } 997 998&:disabled { 999color: gtkalpha(currentColor, $enabled_opacity * $disabled_opacity); 1000 1001> label { color: inherit; } 1002} 1003 1004&:checked { 1005border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 1006currentColor 100%, 1007transparent 0%) 10080 0 2 / 0 0 2px; 1009background-color: transparent; 1010color: currentColor; 1011 1012&:disabled { 1013background-color: transparent; 1014color: gtkalpha(currentColor, $disabled_opacity); 1015 1016> label { color: inherit; } 1017} 1018} 1019} 1020 1021button.suggested-action, button.destructive-action { 1022&:disabled { 1023color: gtkalpha(currentColor, $disabled_opacity); 1024 1025> label { color: inherit; } 1026} 1027} 1028 1029&.selection-mode { 1030transition: background-color 0 $material_slower, color $material_faster $material_ease_out; 1031animation: header_ripple_effect $material_slower $material_ease_out; 1032// box-shadow: $z-depth-1, inset 0 1px $secondary_highlight_color; 1033background-color: $selected_bg_color; 1034color: $selected_fg_color; 1035 1036&:backdrop { 1037color: $secondary_selected_fg_color; 1038} 1039 1040.subtitle:link { @extend *:link:selected; } 1041 1042button:not(.suggested-action):not(.destructive-action) { 1043border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 1044currentColor 0%, 1045transparent 0%) 10460 0 0 / 0 0 0px; 1047// color: gtkalpha(currentColor, $enabled_opacity); 1048 1049&, &:hover, &:active { color: currentColor; } 1050 1051&:disabled { 1052color: gtkalpha(currentColor, $disabled_opacity); 1053 1054> label { color: inherit; } 1055} 1056 1057&:checked { 1058border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 1059currentColor 100%, 1060transparent 0%) 10610 0 2 / 0 0 2px; 1062color: currentColor; 1063 1064&:disabled { 1065color: gtkalpha(currentColor, $disabled_opacity); 1066 1067> label { color: inherit; } 1068} 1069} 1070} 1071 1072.selection-menu { 1073padding-left: 16px; 1074padding-right: 16px; 1075 1076GtkArrow { -GtkArrow-arrow-scaling: 1; } 1077 1078.arrow { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 1079} 1080} 1081 1082.fullscreen &, 1083.tiled &, 1084.maximized & { 1085border-radius: 0; // squared corners when the window is max'd or tiled 1086box-shadow: $z-depth-1; 1087} 1088 1089&.default-decoration { 1090min-height: $small_size; 1091padding: $container_padding; 1092border-width: 0; 1093 1094button.titlebutton { 1095min-height: $small_size; 1096min-width: $small_size; 1097margin: 0; 1098padding: 0; 1099 1100&:active { // add fallback 1101background-image: radial-gradient(circle farthest-corner at center, 1102gtkalpha(currentColor, $lower_opacity / 2) 100%, 1103transparent 0%), 1104image(gtkalpha(currentColor, $lower_opacity / 2)); 1105} 1106} 1107} 1108} 1109 1110headerbar { 1111// add vertical margins to headerbar entries, buttons and separators to avoid them spanning the whole height 1112entry, 1113spinbutton, 1114// separator, 1115button { 1116margin-top: $container_padding; 1117margin-bottom: $container_padding; 1118} 1119} 1120 1121.titlebar { 1122border-top-left-radius: 2px; 1123border-top-right-radius: 2px; 1124} 1125 1126headerbar { 1127separator:first-child + &, // tackles the paned container case 1128&:first-child { 1129border-top-left-radius: 2px; 1130 1131.tiled &, 1132.maximized & { border-radius: 0; } 1133} 1134 1135&:last-child { 1136border-top-right-radius: 2px; 1137 1138.tiled &, 1139.maximized & { border-radius: 0; } 1140} 1141} 1142 1143.titlebar:not(headerbar) { 1144window.csd > & { 1145// in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases 1146padding: 0; 1147background-color: transparent; 1148background-image: none; 1149border-style: none; 1150box-shadow: none; 1151} 1152 1153> separator { 1154background-color: $headerbar_color; 1155background-image: image($borders_color); 1156} 1157 1158@extend %titlebar; 1159} 1160 1161 1162/************ 1163* Pathbars * 1164************/ 1165.path-bar button { 1166&.text-button, &.image-button, & { 1167padding-left: 6px; 1168padding-right: 6px; 1169} 1170 1171&.text-button.image-button, & { 1172// label:last-child { padding-left: 2px; padding-right: 8px; } 1173// label:first-child { padding-left: 8px; padding-right: 2px; } 1174} 1175 1176image { 1177padding-left: 4px; 1178padding-right: 4px; 1179} 1180 1181&.slider-button { 1182padding-left: 0; 1183padding-right: 0; 1184} 1185} 1186 1187 1188/************** 1189* Tree Views * 1190**************/ 1191treeview.view { 1192-GtkTreeView-grid-line-width: 1; 1193-GtkTreeView-grid-line-pattern: ''; 1194-GtkTreeView-tree-line-width: 1; 1195-GtkTreeView-tree-line-pattern: ''; 1196-GtkTreeView-expander-size: 16; 1197 1198border-left-color: $track_color; // this is actually the tree lines color, 1199border-top-color: $borders_color; // while this is the grid lines color, better then nothing 1200 1201rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props 1202 1203&:hover, &:active, &:selected { border-radius: 0; } 1204 1205&.separator { 1206min-height: 1px + 2px * 2; 1207color: $borders_color; 1208} 1209 1210&:drop(active) { 1211border-style: solid none; 1212border-width: 1px; 1213border-color: $accent_bg_color; 1214 1215&.after { border-top-style: none; } 1216 1217&.before { border-bottom-style: none; } 1218} 1219 1220&.expander { 1221-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1222-gtk-icon-transform: rotate(-90deg); 1223 1224&:dir(rtl) { -gtk-icon-transform: rotate(90deg); } 1225 1226&:checked { -gtk-icon-transform: unset; } 1227 1228color: $secondary_fg_color; 1229 1230&:hover, &:active { color: $fg_color; } 1231 1232&:disabled { color: $insensitive_secondary_fg_color; } 1233 1234&:selected { 1235color: $secondary_selected_fg_color; 1236 1237&:hover, &:active { color: $selected_fg_color; } 1238 1239&:disabled { color: $insensitive_secondary_selected_fg_color; } 1240} 1241} 1242 1243&.progressbar { // progress bar in treeviews 1244border-style: none none solid; 1245border-width: $bar_size; 1246border-color: $selected_bg_color; 1247background-color: transparent; 1248background-image: none; 1249 1250&:selected { border-color: currentColor; } 1251} 1252 1253&.trough { // progress bar trough in treeviews 1254border-style: none none solid; 1255border-width: $bar_size; 1256border-color: scale-alpha($selected_bg_color, $lower_opacity); 1257background-color: transparent; 1258background-image: none; 1259 1260&:selected { border-color: $track_color; } 1261} 1262 1263header { 1264button { 1265@extend row.activatable; 1266 1267padding: 2px 6px; 1268border-style: none solid solid none; 1269border-width: 1px; 1270border-color: $borders_color; 1271border-radius: 0; 1272background-clip: border-box; 1273 1274&, &:hover, &:active { box-shadow: none; } 1275 1276&, &:disabled { background-color: $base_color; } 1277 1278&:last-child { border-right-style: none; } 1279} 1280} 1281 1282button.dnd, 1283header.button.dnd { // for treeview-like derive widgets 1284padding: 2px 6px; 1285border-style: none solid solid; 1286border-width: 1px; 1287border-color: $borders_color; 1288border-radius: 0; 1289box-shadow: none; 1290background-color: $base_color; 1291background-clip: border-box; 1292color: $selected_bg_color; 1293} 1294} 1295 1296 1297/********* 1298* Menus * 1299*********/ 1300menubar, 1301.menubar { 1302-GtkWidget-window-dragging: true; 1303padding: 0; 1304// box-shadow: inset 0 -1px $borders_color; 1305background-color: $headerbar_color; 1306 1307> menuitem { 1308transition: background-color $material_faster $material_ease_out; 1309min-height: 20px; 1310padding: 4px 8px; 1311color: $secondary_selected_fg_color; 1312 1313&:hover { //Seems like it :hover even with keyboard focus 1314transition: none; 1315background-color: gtkalpha(currentColor, $lower_opacity / 2); 1316color: $selected_fg_color; 1317} 1318 1319&:disabled { color: $insensitive_secondary_selected_fg_color; } 1320} 1321} 1322 1323menu, 1324.menu { 1325margin: 4px 0; 1326padding: 4px 0; 1327background-color: $base_color; 1328border: 1px solid $borders_color; // adds borders in a non composited env 1329 1330.csd & { 1331border: none; // axes borders in a composited env 1332border-radius: 2px; 1333} 1334 1335menuitem { 1336transition: background-color $material_faster $material_ease_out; 1337min-height: 20px; 1338min-width: 40px; 1339padding: 4px 8px; 1340font: initial; 1341text-shadow: none; 1342 1343&:hover { 1344transition: none; 1345background-color: gtkalpha(currentColor, $lower_opacity / 2); 1346} 1347 1348&:disabled { color: $insensitive_fg_color; } 1349 1350// submenu indicators 1351arrow { 1352min-height: 16px; 1353min-width: 16px; 1354 1355&:dir(ltr) { 1356-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1357margin-left: 8px; 1358} 1359 1360&:dir(rtl) { 1361-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); 1362margin-right: 8px; 1363} 1364} 1365} 1366 1367// overflow arrows 1368> arrow { 1369min-height: 16px; 1370min-width: 16px; 1371padding: 4px; 1372border-radius: 0; 1373background-color: $base_color; 1374color: $secondary_fg_color; 1375 1376&.top { 1377margin-top: -4px; 1378border-bottom: 1px solid $borders_color; 1379-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 1380} 1381 1382&.bottom { 1383margin-bottom: -4px; 1384border-top: 1px solid $borders_color; 1385-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1386} 1387 1388&:hover { 1389background-image: image(gtkalpha(currentColor, $lower_opacity / 2)); 1390color: $fg_color; 1391} 1392 1393&:disabled { 1394border-color: transparent; 1395background-color: transparent; 1396color: transparent; 1397// color: $insensitive_secondary_fg_color; 1398} 1399} 1400 1401separator { margin: 4px 0; } 1402} 1403 1404menuitem { 1405accelerator { color: gtkalpha(currentColor, $hint_opacity); } 1406 1407check, 1408radio { 1409&:dir(ltr) { margin-right: -8px; margin-left: -16px; } 1410&:dir(rtl) { margin-right: -16px; margin-left: -8px; } 1411} 1412} 1413 1414.csd.popup { border-radius: 2px; } 1415 1416 1417/*************** 1418* Popovers * 1419***************/ 1420popover.background { 1421transition: $shadow_transition; 1422padding: 0; 1423box-shadow: $z-depth-2; 1424background-color: $light_color; 1425 1426&:backdrop { box-shadow: $z-depth-1; } 1427 1428&, .csd & { 1429border-style: solid; 1430border-width: 1px; 1431border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3); 1432border-radius: 2px + 1px; 1433} 1434 1435> list, 1436> .view, 1437> toolbar { 1438border-style: none; 1439box-shadow: none; 1440background-color: transparent; 1441} 1442 1443&, .csd & { 1444&.touch-selection, 1445&.magnifier, 1446&.osd { @extend %osd; } 1447} 1448 1449separator { margin: 4px 0; } 1450 1451list separator { margin: 0; } 1452} 1453 1454/************* 1455* Notebooks * 1456*************/ 1457notebook { 1458> header { 1459border-width: 1px; 1460border-color: $borders_color; 1461background-color: $bg_color; 1462background-clip: border-box; 1463 1464&.top { 1465border-bottom-style: solid; 1466> tabs { 1467margin-bottom: -1px; 1468> tab { 1469 1470&:hover { box-shadow: inset 0 -2px $track_color; } 1471 1472&:checked { box-shadow: inset 0 -2px $selected_bg_color; } 1473} 1474} 1475} 1476 1477&.bottom { 1478border-top-style: solid; 1479> tabs { 1480margin-top: -1px; 1481> tab { 1482 1483&:hover { box-shadow: inset 0 2px $track_color; } 1484 1485&:checked { box-shadow: inset 0 2px $selected_bg_color; } 1486} 1487} 1488} 1489 1490&.left { 1491border-right-style: solid; 1492> tabs { 1493margin-right: -1px; 1494> tab { 1495 1496&:hover { box-shadow: inset -2px 0 $track_color; } 1497 1498&:checked { box-shadow: inset -2px 0 $selected_bg_color; } 1499} 1500} 1501} 1502 1503&.right { 1504border-left-style: solid; 1505> tabs { 1506margin-left: -1px; 1507> tab { 1508 1509&:hover { box-shadow: inset 2px 0 $track_color; } 1510 1511&:checked { box-shadow: inset 2px 0 $selected_bg_color; } 1512} 1513} 1514} 1515 1516&.top > tabs > arrow { 1517@extend %notebook_vert_arrows; 1518 1519border-top-style: none; 1520} 1521 1522&.bottom > tabs > arrow { 1523@extend %notebook_vert_arrows; 1524 1525border-bottom-style: none; 1526} 1527 1528@at-root %notebook_vert_arrows { 1529padding-left: 4px; 1530padding-right: 4px; 1531 1532&.down { 1533margin-left: -8px; 1534-gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); 1535} 1536 1537&.up { 1538margin-right: -8px; 1539-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1540} 1541} 1542 1543&.left > tabs > arrow { 1544@extend %notebook_horz_arrows; 1545 1546border-left-style: none; 1547} 1548 1549&.right > tabs > arrow { 1550@extend %notebook_horz_arrows; 1551 1552border-right-style: none; 1553} 1554 1555@at-root %notebook_horz_arrows { 1556padding-top: 4px; 1557padding-bottom: 4px; 1558 1559&.down { 1560margin-top: -8px; 1561-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 1562} 1563 1564&.up { 1565margin-bottom: -8px; 1566-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1567} 1568} 1569 1570> tabs > arrow { 1571@extend %button_basic.flat; 1572 1573min-height: 16px; 1574min-width: 16px; 1575border-radius: 0; 1576} 1577 1578tab { 1579transition: $material_transition; 1580min-height: 24px; 1581min-width: 24px; 1582padding: 6px 12px; 1583 1584outline-offset: -6px; 1585 1586border-width: 1px; // for reorderable tabs 1587border-color: transparent; // 1588 1589color: $secondary_fg_color; 1590font-weight: 500; 1591 1592&:hover { 1593color: $fg_color; 1594 1595&.reorderable-page { 1596border-color: $borders_color; 1597background-color: $secondary_base_color; 1598} 1599} 1600 1601&:disabled { color: $insensitive_secondary_fg_color; } 1602 1603&:checked { 1604animation: tab_ripple_effect $material_slower * 3 $material_ease_out; 1605color: $fg_color; 1606 1607&:disabled { color: $insensitive_fg_color; } 1608 1609&.reorderable-page { 1610border-color: $borders_color; 1611background-color: $base_color; 1612} 1613} 1614 1615// colors the button like the label, overridden otherwise 1616button.flat { 1617// FIXME: generalize .small-button? 1618min-width: $small_size; 1619min-height: $small_size; 1620padding: 0; 1621 1622@extend %button_basic.image-button; 1623 1624&:last-child { 1625margin-left: 6px; 1626margin-right: -6px; 1627} 1628 1629&:first-child { 1630margin-left: -6px; 1631margin-right: 6px; 1632} 1633} 1634} 1635 1636&.top, 1637&.bottom { 1638tabs { 1639padding-left: 8px; 1640padding-right: 8px; 1641 1642&:not(:only-child) { 1643&:first-child { margin-left: 0; } 1644&:last-child { margin-right: 0; } 1645} 1646 1647tab { 1648&.reorderable-page { 1649margin: 0 -1px; 1650border-style: none solid; 1651} 1652} 1653} 1654} 1655 1656&.left, 1657&.right { 1658tabs { 1659padding-top: 8px; 1660padding-bottom: 8px; 1661 1662&:not(:only-child) { 1663&:first-child { margin-top: 0; } 1664&:last-child { margin-bottom: 0; } 1665} 1666 1667tab { 1668&.reorderable-page { 1669margin: -1px 0; 1670border-style: solid none; 1671} 1672} 1673} 1674} 1675} 1676 1677> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks 1678background-color: $base_color; 1679 1680entry, 1681spinbutton:not(.vertical) { @extend %entry.flat; } 1682 1683revealer entry, 1684revealer spinbutton:not(.vertical) { @extend %entry; } 1685 1686spinbutton:not(.vertical) entry { @extend %spinbutton_entry; } 1687} 1688} 1689 1690 1691/************** 1692* Scrollbars * 1693**************/ 1694scrollbar { 1695$_slider_min_length: 24px; 1696 1697// disable steppers 1698@at-root * { 1699-GtkScrollbar-has-backward-stepper: false; 1700-GtkScrollbar-has-forward-stepper: false; 1701} 1702 1703transition: $material_transition; 1704background-color: $base_color; 1705background-clip: $extra_background_clip; 1706 1707// scrollbar border 1708&.top { border-bottom: 1px solid $borders_color; } 1709&.bottom { border-top: 1px solid $borders_color; } 1710&.left { border-right: 1px solid $borders_color; } 1711&.right { border-left: 1px solid $borders_color; } 1712 1713// slider 1714slider { 1715transition: all $material_faster $material_ease_out, margin 0, border-width 0; 1716min-width: 8px; 1717min-height: 8px; 1718border: 4px solid transparent; 1719border-radius: 100px; 1720background-clip: padding-box; 1721background-color: $tertiary_fg_color; 1722 1723&:hover { background-color: $secondary_fg_color; } 1724 1725&:active { background-color: $fg_color; } 1726 1727&:disabled { background-color: $insensitive_tertiary_fg_color; } 1728} 1729 1730&.fine-tune { 1731slider { 1732transition: all $material_faster $material_ease_out, margin 0, border-width 0, min-width 0, min-height 0; 1733min-width: 4px; 1734min-height: 4px; 1735} 1736 1737&.horizontal slider { margin: 2px 0; } 1738 1739&.vertical slider { margin: 0 2px; } 1740} 1741 1742&.overlay-indicator { 1743&:not(.dragging):not(.hovering) { 1744border-color: transparent; 1745background-color: transparent; 1746 1747slider { 1748min-width: 4px; 1749min-height: 4px; 1750margin: 2px; 1751border: 2px solid scale-alpha($base_color, $lower_opacity); 1752} 1753 1754button { 1755min-width: 4px; 1756min-height: 4px; 1757margin: 2px; 1758border: 2px solid scale-alpha($base_color, $lower_opacity); 1759border-radius: 100px; 1760background-color: $tertiary_fg_color; 1761background-clip: padding-box; 1762-gtk-icon-source: none; 1763 1764&:disabled { background-color: $insensitive_tertiary_fg_color; } 1765} 1766 1767&.horizontal { 1768slider { min-width: $_slider_min_length; } 1769 1770button { min-width: 8px; } 1771} 1772 1773&.vertical { 1774slider { min-height: $_slider_min_length; } 1775 1776button { min-height: 8px; } 1777} 1778} 1779 1780&.dragging, 1781&.hovering { background-color: scale-alpha($base_color, $higher_opacity); } 1782} 1783 1784&.horizontal slider { min-width: $_slider_min_length; } 1785 1786&.vertical slider { min-height: $_slider_min_length; } 1787 1788// button styling 1789button { 1790@extend %button_basic.flat; 1791min-width: 16px; 1792min-height: 16px; 1793padding: 0; 1794border-radius: 0; 1795} 1796 1797// button icons 1798&.vertical { 1799button { 1800&.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 1801 1802&.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); } 1803} 1804} 1805 1806&.horizontal { 1807button { 1808&.down { -gtk-icon-source: -gtk-icontheme('pan-right-symbolic'); } 1809 1810&.up { -gtk-icon-source: -gtk-icontheme('pan-left-symbolic'); } 1811} 1812} 1813} 1814 1815 1816/********** 1817* Switch * 1818**********/ 1819switch { 1820transition: $material_transition; 1821margin: $container_padding 0; 1822border: 4px solid transparent; 1823border-radius: 100px; 1824background-color: $track_color; 1825background-clip: padding-box; 1826font-size: 0; 1827 1828&:disabled { color: $insensitive_fg_color; } 1829 1830&:checked { 1831background-color: scale-alpha($accent_bg_color, 0.5); 1832 1833&:disabled { 1834background-color: scale-alpha($accent_bg_color, 0.5 * $disabled_opacity); 1835color: $insensitive_fg_color; 1836} 1837} 1838 1839slider { 1840@include entry(normal); 1841 1842transition: $material_transition, margin 0; 1843min-width: $small_size; 1844min-height: $small_size; 1845margin: -4px 0 -4px -4px; 1846-gtk-outline-radius: 100px; 1847border-radius: 100px; 1848} 1849 1850&:hover slider { @include entry(focus); } 1851 1852&:disabled slider { @include entry(insensitive); } 1853 1854&:checked slider { 1855transition: $material_transition, margin 0, background-image 0, background-color 0 $material_slower; 1856animation: needs_attention $material_slower $material_ease_out; 1857margin: -4px -4px -4px 0; 1858background-color: $accent_bg_color; 1859color: $selected_fg_color; 1860} 1861 1862&:checked:disabled slider { animation: none; } 1863 1864row:selected & { 1865} 1866} 1867 1868 1869/************************* 1870* Check and Radio items * 1871*************************/ 1872// draw regular check and radio items using our PNG assets 1873// all assets are rendered from assets.svg. never add pngs directly 1874 1875//selection-mode 1876@each $s,$as in ('','-selectionmode'), 1877(':hover', '-hover-selectionmode'), 1878(':checked', '-checked-selectionmode'), 1879(':checked:hover', '-checked-hover-selectionmode') { 1880.view.content-view.check#{$s}:not(list) { 1881-gtk-icon-shadow: $z-depth-1; 1882-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}#{$asset_suffix}.png"), 1883url("assets/checkbox#{$as}#{$asset_suffix}@2.png")); 1884margin: 8px; 1885background-color: transparent; 1886} 1887} 1888 1889checkbutton.text-button, 1890radiobutton.text-button { 1891// this is for a nice focus on check and radios text 1892padding: 2px; 1893outline-offset: 0; 1894 1895label:not(:only-child) { margin: 0 4px; } 1896} 1897 1898check, 1899radio { 1900min-height: 24px; 1901min-width: 24px; 1902margin: -12px; 1903padding: 12px; 1904 1905@extend %button_basic.flat; 1906 1907@extend %button_basic.image-button; 1908 1909&:checked, &:checked:disabled { background-color: transparent; } 1910 1911&:checked, &:indeterminate { color: $accent_bg_color; } 1912 1913&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); } 1914 1915// &:only-child { margin: -12px; } 1916 1917row &:not(:checked):not(:indeterminate) { 1918color: gtkalpha(currentColor, $enabled_opacity); 1919 1920&:hover, &:active { color: currentColor; } 1921} 1922 1923menu menuitem & { 1924transition: none; 1925margin: -16px; // this is a workaround for a menu check/radio size allocation issue 1926 1927&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $hint_opacity); } 1928 1929&, &:hover, &:disabled { 1930background-image: none; 1931// color: inherit; 1932// animation: none; 1933} 1934} 1935} 1936 1937%check, 1938check { 1939& { -gtk-icon-source: image(-gtk-recolor(url("assets/check-unchecked-symbolic.svg")), 1940-gtk-recolor(url("assets/check-unchecked-symbolic.png"))); } 1941 1942&:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-checked-symbolic.svg")), 1943-gtk-recolor(url("assets/check-checked-symbolic.png"))); } 1944 1945&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/check-dash-symbolic.svg")), 1946-gtk-recolor(url("assets/check-dash-symbolic.png"))); } 1947} 1948 1949%radio, 1950radio { 1951& { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-unchecked-symbolic.svg")), 1952-gtk-recolor(url("assets/radio-unchecked-symbolic.png"))); } 1953 1954// &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")), 1955// -gtk-recolor(url("assets/radio-checked-symbolic.png"))); } 1956 1957&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-dash-symbolic.svg")), 1958-gtk-recolor(url("assets/radio-dash-symbolic.png"))); } 1959 1960border-image: -gtk-gradient(radial, 1961center center, 0, 1962center center, 0.001, 1963to($accent_bg_color), 1964to(transparent)) 196524 / 24px; 1966 1967&:checked { 1968border-image: -gtk-gradient(radial, 1969center center, 0, 1970center center, (10 / 48 / 2), 1971to($accent_bg_color), 1972to(transparent)) 197324 / 24px; 1974} 1975 1976&:checked:disabled { 1977border-image: -gtk-gradient(radial, 1978center center, 0, 1979center center, (10 / 48 / 2), 1980to(scale-alpha($accent_bg_color, $disabled_opacity)), 1981to(transparent)) 198224 / 24px; 1983} 1984 1985&:indeterminate:checked { 1986border-image: -gtk-gradient(radial, 1987center center, 0, 1988center center, 0.001, 1989to($accent_bg_color), 1990to(transparent)) 199124 / 24px; 1992} 1993} 1994 1995// let's animate things 1996@keyframes check_check { 1997from { -gtk-icon-transform: rotate(90deg); } 1998to { -gtk-icon-transform: unset; } 1999} 2000 2001@keyframes check_radio { // FIXME: cannot animate border-image 2002from { 2003border-image: -gtk-gradient(radial, 2004center center, 0, 2005center center, 0.001, 2006to($accent_bg_color), 2007to(transparent)) 200824 / 24px; 2009} 2010 2011to { 2012border-image: -gtk-gradient(radial, 2013center center, 0, 2014center center, (10 / 48 / 2), 2015to($accent_bg_color), 2016to(transparent)) 201724 / 24px; 2018} 2019} 2020 2021@keyframes check_indeterminate { 2022from { -gtk-icon-transform: unset; } 202350% { -gtk-icon-transform: scale(0, 1); } 2024to { -gtk-icon-transform: unset; } 2025} 2026 2027%check_checked, 2028check:not(:indeterminate):checked { animation: check_check $material_slower $material_ease; } 2029 2030check:not(:indeterminate):checked:active { animation: check_check $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; } 2031 2032// %radio_checked, 2033// radio:not(:indeterminate):checked { animation: check_radio $material_slower $material_ease; } 2034 2035// radio:not(:indeterminate):checked:active { animation: check_radio $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; } 2036 2037%indeterminate_checked, 2038check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate $material_slower $material_ease; } 2039 2040check:indeterminate:checked:active, radio:indeterminate:checked:active { animation: check_indeterminate $material_slower $material_ease, flat_ripple_effect $material_slower $material_ease_out forwards; } 2041 2042// no animations in menus 2043menu menuitem { 2044check:not(:indeterminate):checked, 2045radio:not(:indeterminate):checked, 2046check:indeterminate:checked, 2047radio:indeterminate:checked { animation: none; } 2048} 2049 2050treeview.view check, 2051treeview.view radio { 2052padding: 0; 2053 2054&:checked:hover, &:selected:checked:hover { background-image: none; } 2055 2056& { 2057color: $secondary_fg_color; 2058 2059&:hover, &:active { color: $fg_color; } 2060 2061&:disabled { color: $insensitive_secondary_fg_color; } 2062 2063&:checked, &:indeterminate { color: $accent_bg_color; } 2064 2065&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); } 2066} 2067 2068&:selected { 2069color: $secondary_selected_fg_color; 2070 2071&:hover, &:active { color: $selected_fg_color; } 2072 2073&:disabled { color: $insensitive_secondary_selected_fg_color; } 2074 2075&:checked, &:indeterminate { color: $accent_bg_color; } 2076 2077&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_bg_color, $disabled_opacity); } 2078} 2079} 2080 2081treeview.view radio:checked { 2082-gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")), 2083-gtk-recolor(url("assets/radio-checked-symbolic.png"))); 2084border-image: none; 2085} 2086 2087 2088/************ 2089* GtkScale * 2090************/ 2091scale { 2092// sizing 2093 2094$_marks_lenght: 8px; 2095$_marks_distance: 8px; 2096 2097min-height: 12px; 2098min-width: 12px; 2099padding: 12px; 2100 2101* { transition: $material_transition; } 2102 2103// the slider is inside the trough, so to have make it bigger there's a negative margin 2104slider { 2105min-height: $small_size; 2106min-width: $small_size; 2107margin: -10px; 2108} 2109 2110// the backing bit 2111trough { 2112outline-offset: 2px; 2113background-color: $track_color; 2114 2115&:disabled { color: $insensitive_fg_color; } 2116} 2117 2118// the colored part of the backing bit 2119highlight { 2120background-color: $accent_bg_color; 2121 2122&:disabled { background-color: transparent; } 2123} 2124 2125// this is another differently styled part of the backing bit, the most relevant use case is for example 2126// in media player to indicate how much video stream as been cached 2127fill { 2128background-color: $track_color; 2129 2130&:disabled { background-color: transparent; } 2131} 2132 2133slider { 2134transition: all $material_faster $material_ease; 2135// border-radius: 100%; 2136// background-color: $accent_bg_color; 2137background-repeat: no-repeat; 2138background-position: center; 2139 2140@each $s,$as in ('',''), 2141(':disabled','-insensitive') { 2142&#{$s} { 2143$_url: 'assets/slider#{$as}#{$asset_suffix}'; 2144background-image: -gtk-scaled(url('#{$_url}.png'), 2145url('#{$_url}@2.png')); 2146} 2147} 2148 2149background-size: calc(100% - 8px); 2150 2151&:hover { background-size: calc(100% - 4px); } 2152 2153&:active { background-size: calc(100% - 0px); } 2154} 2155 2156// click-and-hold the slider to activate 2157&.fine-tune { 2158// to make the slider shrink in fine-tune mode 2159slider { background-size: calc(100% - 12px); } 2160} 2161 2162value { color: gtkalpha(currentColor, $hint_opacity); } 2163 2164marks { 2165color: $track_color; 2166 2167@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom), 2168(bottom, bottom, top), 2169(top, left, right), 2170(bottom, right, left) { 2171&.#{$marks_class} { 2172margin-#{$marks_margin}: $_marks_distance; 2173margin-#{$marks_pos}: -($_marks_distance + $_marks_lenght); 2174} 2175} 2176} 2177 2178&.horizontal { 2179indicator { 2180min-height: $_marks_lenght; 2181min-width: 1px; 2182} 2183} 2184 2185&.vertical { 2186indicator { 2187min-height: 1px; 2188min-width: $_marks_lenght; 2189} 2190} 2191 2192// *WARNING* scale with marks madness following 2193 2194// FIXME: OSD and selected list rows missing, I don't feel like adding the other 144 assets needed for those... 2195$suffix: if($variant == 'light', '', '-dark'); 2196 2197@each $dir_class, $dir_infix in ('horizontal', 'horz'), 2198('vertical', 'vert') { 2199@each $marks_infix, $nth_child in ('scale-has-marks-above', ':last-child:not(:only-child)'), 2200('scale-has-marks-below', ':first-child:not(:only-child)') { 2201@each $state, $state_infix in ('', ''), 2202(':disabled', '-insensitive') { 2203&.#{$dir_class} { 2204%#{$marks_infix}-#{$dir_infix}, 2205contents#{$nth_child} > trough > slider { 2206&#{$state} { 2207$_scale_asset: 'assets/slider-#{$dir_infix}-#{$marks_infix}#{$state_infix}#{$suffix}'; 2208 2209background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png')); 2210} 2211 2212@if $dir_class == 'horizontal' { 2213min-height: 30px; 2214min-width: $small_size; 2215 2216@if $marks_infix == 'scale-has-marks-above' { 2217margin-top: -16px; 2218 2219background-position: center calc(100% - 4px); 2220 2221&:hover { background-position: center calc(100% - 2px); } 2222 2223&:active { background-position: center calc(100% - 0px); } 2224} 2225 2226@if $marks_infix == 'scale-has-marks-below' { 2227margin-bottom: -16px; 2228 2229background-position: center calc(4px); 2230 2231&:hover { background-position: center calc(2px); } 2232 2233&:active { background-position: center calc(0px); } 2234} 2235} 2236 2237@if $dir_class == 'vertical' { 2238min-height: $small_size; 2239min-width: 30px; 2240 2241@if $marks_infix == 'scale-has-marks-above' { 2242margin-left: -16px; 2243 2244background-position: calc(4px) center; 2245 2246&:hover { background-position: calc(2px) center; } 2247 2248&:active { background-position: calc(0px) center; } 2249} 2250 2251@if $marks_infix == 'scale-has-marks-below' { 2252margin-right: -16px; 2253 2254background-position: calc(100% - 4px) center; 2255 2256&:hover { background-position: calc(100% - 2px) center; } 2257 2258&:active { background-position: calc(100% - 0px) center; } 2259} 2260} 2261} 2262 2263@at-root %#{$marks_infix}-#{$dir_infix}-fine-tune, 2264&.fine-tune contents#{$nth_child} > trough > slider { 2265// bigger negative margins to make the trough grow here as well 2266 2267@if $dir_class == 'horizontal' { 2268@if $marks_infix == 'scale-has-marks-above' { background-position: center calc(100% - 6px); } 2269 2270@if $marks_infix == 'scale-has-marks-below' { background-position: center calc(6px); } 2271} 2272 2273@if $dir_class == 'vertical' { 2274@if $marks_infix == 'scale-has-marks-above' { background-position: calc(6px) center; } 2275 2276@if $marks_infix == 'scale-has-marks-below' { background-position: calc(100% - 6px) center; } 2277} 2278} 2279} 2280} 2281} 2282} 2283 2284&.color { 2285min-height: 0; 2286min-width: 0; 2287 2288&.horizontal { 2289padding: 0 0 12px 0; 2290 2291trough { 2292padding-bottom: $bar_size; 2293} 2294 2295slider { 2296@extend %scale-has-marks-above-horz; 2297 2298margin-bottom: -10px - $bar_size; 2299margin-top: 0; 2300} 2301} 2302 2303&.vertical { 2304&:dir(ltr) { 2305padding: 0 0 0 12px; 2306 2307trough { 2308padding-left: $bar_size; 2309} 2310 2311slider { 2312@extend %scale-has-marks-below-vert; 2313 2314margin-left: -10px - $bar_size; 2315margin-right: 0; 2316} 2317} 2318 2319&:dir(rtl) { 2320padding: 0 12px 0 0; 2321 2322trough { 2323padding-right: $bar_size; 2324} 2325 2326slider { 2327@extend %scale-has-marks-above-vert; 2328 2329margin-right: -10px - $bar_size; 2330margin-left: 0; 2331} 2332} 2333} 2334 2335&.fine-tune { 2336&.horizontal { 2337slider { 2338@extend %scale-has-marks-above-horz-fine-tune; 2339} 2340} 2341 2342&.vertical { 2343&:dir(ltr) { 2344slider { 2345@extend %scale-has-marks-below-vert-fine-tune; 2346} 2347} 2348 2349&:dir(rtl) { 2350slider { 2351@extend %scale-has-marks-above-vert-fine-tune; 2352} 2353} 2354} 2355} 2356} 2357} 2358 2359 2360/***************** 2361* Progress bars * 2362*****************/ 2363progressbar { 2364// sizing 2365&.horizontal { 2366trough, 2367progress { min-height: $bar_size; } 2368} 2369 2370&.vertical { 2371trough, 2372progress { min-width: $bar_size; } 2373} 2374 2375// FIXME: insensitive state missing and some other state should be set probably 2376color: $tertiary_fg_color; 2377font-size: smaller; 2378 2379trough { background-color: scale-alpha($selected_bg_color, $lower_opacity); } 2380 2381progress { background-color: $selected_bg_color; } 2382 2383&.osd { // progressbar.osd used for epiphany page loading progress 2384// min-width: $bar_size; 2385// min-height: $bar_size; 2386// background-color: transparent; 2387 2388// trough { background-color: transparent; } 2389 2390progress { 2391} 2392} 2393} 2394 2395 2396/************* 2397* Level Bar * 2398*************/ 2399levelbar { 2400block { 2401min-width: $medium_size; 2402min-height: $bar_size; 2403} 2404 2405&.vertical block { 2406min-width: $bar_size; 2407min-height: $medium_size; 2408} 2409 2410trough { 2411padding: 2px; 2412border-radius: 2px; 2413 2414@include entry(normal); 2415 2416&:disabled { @include entry(insensitive); } 2417} 2418 2419&.horizontal.discrete block { margin: 0 1px; } 2420 2421&.vertical.discrete block { margin: 1px 0; } 2422 2423&.horizontal.discrete trough { padding: 2px 1px; } 2424 2425&.vertical.discrete trough { padding: 1px 2px; } 2426 2427block { 2428&.low { 2429background-color: $warning_color; 2430} 2431 2432&.high { 2433background-color: $selected_bg_color; 2434} 2435 2436&.full { 2437background-color: $success_color; 2438} 2439 2440&.empty { 2441background-color: $track_color; 2442color: $insensitive_fg_color; 2443} 2444} 2445} 2446 2447 2448/**************** 2449* Print dialog * 2450*****************/ 2451printdialog { 2452paper { 2453padding: 0; 2454border: 1px solid $borders_color; 2455background: $base_color; 2456color: $fg_color; 2457} 2458 2459.dialog-action-box { margin: 12px; } 2460} 2461 2462 2463/********** 2464* Frames * 2465**********/ 2466frame > border, 2467.frame { 2468margin: 0; 2469padding: 0; 2470border: 1px solid $borders_color; 2471border-radius: 0; 2472box-shadow: none; 2473 2474&.flat { border-style: none; } 2475} 2476 2477actionbar > revealer > box { 2478padding: $container_padding; 2479border-top: 1px solid $borders_color; 2480} 2481 2482scrolledwindow { 2483viewport.frame { // avoid double borders when viewport inside scrolled window 2484border-style: none; 2485} 2486 2487// This is used when content is touch-dragged past boundaries. 2488// draws a box on top of the content, the size changes programmatically. 2489overshoot { 2490&.top { @include overshoot(top); } 2491 2492&.bottom { @include overshoot(bottom); } 2493 2494&.left { @include overshoot(left); } 2495 2496&.right { @include overshoot(right); } 2497} 2498 2499// Overflow indication, works similarly to the overshoot, the size if fixed tho. 2500undershoot { 2501&.top { @include undershoot(top); } 2502 2503&.bottom { @include undershoot(bottom); } 2504 2505&.left { @include undershoot(left); } 2506 2507&.right { @include undershoot(right); } 2508} 2509 2510junction { // the small square between two scrollbars 2511border-style: solid none none solid; 2512border-width: 1px; 2513border-color: $borders_color; 2514background-color: $base_color; 2515 2516&:dir(rtl) { border-style: solid solid none none; } 2517} 2518} 2519 2520//vbox and hbox separators 2521separator { 2522min-width: 1px; 2523min-height: 1px; 2524background: $borders_color; 2525} 2526 2527 2528/********* 2529* Lists * 2530*********/ 2531list { 2532border-color: $borders_color; 2533background-color: $base_color; 2534 2535row { padding: 2px; } 2536} 2537 2538row { 2539transition: $material_transition; 2540 2541&:hover { transition: none; } 2542 2543&.activatable { 2544background-image: radial-gradient(circle farthest-corner at center, 2545gtkalpha(currentColor, 0) 100%, 2546transparent 0%), 2547image(gtkalpha(currentColor, 0)); 2548 2549&:hover { 2550background-image: radial-gradient(circle farthest-corner at center, 2551gtkalpha(currentColor, 0) 100%, 2552transparent 0%), 2553image(gtkalpha(currentColor, 0.05)); 2554} 2555 2556&.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411 2557&:active { 2558transition: $material_transition, background-image 0; 2559animation: row_ripple_effect $material_slower $material_ease_out forwards; 2560} 2561} 2562 2563&:selected { @extend %selected_items; } 2564} 2565 2566 2567/********************* 2568* App Notifications * 2569*********************/ 2570.app-notification, 2571.app-notification.frame { 2572@extend %osd; 2573 2574@extend toolbar.osd; 2575 2576margin: 8px; 2577 2578border { border: none; } 2579} 2580 2581 2582/************* 2583* Expanders * 2584*************/ 2585expander { 2586arrow { 2587transition: all $material_faster $material_ease; 2588min-width: 16px; 2589min-height: 16px; 2590-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 2591-gtk-icon-transform: rotate(-90deg); 2592 2593&:dir(rtl) { -gtk-icon-transform: rotate(90deg); } 2594 2595&:checked { -gtk-icon-transform: unset; } 2596 2597color: $secondary_fg_color; 2598 2599&:hover, &:active { color: $fg_color; } 2600 2601&:disabled { color: $insensitive_secondary_fg_color; } 2602 2603&:selected { 2604color: $secondary_selected_fg_color; 2605 2606&:hover, &:active { color: $selected_fg_color; } 2607 2608&:disabled { color: $insensitive_secondary_selected_fg_color; } 2609} 2610} 2611} 2612 2613 2614/************ 2615* Calendar * 2616***********/ 2617calendar { 2618padding: 1px; 2619border: 1px solid $borders_color; 2620color: $fg_color; 2621 2622&:disabled { color: $insensitive_fg_color; } 2623 2624&:selected { 2625@extend %selected_items; 2626 2627border-radius: 2px + 1px; 2628} 2629 2630&.header { 2631border-style: none none solid; 2632border-radius: 0; 2633} 2634 2635&.button { @extend %button_basic.flat; } 2636 2637&.highlight { 2638color: gtkalpha(currentColor, $hint_opacity); 2639font-weight: 500; 2640} 2641 2642&:indeterminate { color: gtkalpha(currentColor, $disabled_opacity); } 2643} 2644 2645 2646/*********** 2647* Dialogs * 2648***********/ 2649messagedialog { // Message Dialog styling 2650&.background { background-color: $light_color; } 2651 2652.titlebar { 2653min-height: $small_size; 2654border-style: none; 2655box-shadow: inset 0 1px $highlight_color; 2656background-color: $light_color; 2657} 2658 2659&.csd { // rounded bottom border styling for csd version 2660&.background { 2661// bigger radius for better antialiasing 2662border-bottom-left-radius: 2px; 2663border-bottom-right-radius: 2px; 2664} 2665 2666.dialog-action-area button { 2667padding: 8px 16px; 2668border-top: 1px solid $borders_color; 2669border-radius: 0; 2670 2671@extend %button_basic.flat; 2672 2673&:first-child{ border-bottom-left-radius: 2px; } 2674 2675&:last-child { border-bottom-right-radius: 2px; } 2676} 2677} 2678} 2679 2680filechooser { 2681.dialog-action-box { border-top: 1px solid $borders_color; } 2682 2683#pathbarbox { border-bottom: 1px solid $borders_color; } 2684} 2685 2686filechooserbutton:drop(active) { 2687box-shadow: none; 2688} 2689 2690 2691/*********** 2692* Sidebar * 2693***********/ 2694.sidebar { 2695border-style: none; 2696background-color: $light_color; 2697 2698@at-root %sidebar_left, 2699&:dir(ltr), 2700&.left, 2701&.left:dir(rtl) { 2702border-right: 1px solid $borders_color; 2703border-left-style: none; 2704} 2705 2706@at-root %sidebar_right 2707&:dir(rtl), 2708&.right { 2709border-left: 1px solid $borders_color; 2710border-right-style: none; 2711} 2712 2713list { background-color: transparent; } 2714 2715paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }} 2716} 2717 2718stacksidebar { 2719&.sidebar { 2720&:dir(ltr), 2721&.left, 2722&.left:dir(rtl) { list { @extend %sidebar_left; }} 2723 2724&:dir(rtl), 2725&.right { list { @extend %sidebar_right; }} 2726} 2727 2728row { 2729padding: 10px 4px; 2730 2731> label { 2732padding-left: 6px; 2733padding-right: 6px; 2734} 2735 2736&.needs-attention > label { @extend %needs_attention; } 2737} 2738} 2739 2740 2741/**************** 2742* File chooser * 2743****************/ 2744placessidebar { 2745> viewport.frame { border-style: none; } 2746 2747row { 2748// Needs overriding of the GtkListBoxRow padding 2749min-height: 32px; 2750padding: 0; 2751 2752// Using margins/padding directly in the SidebarRow 2753// will make the animation of the new bookmark row jump 2754> revealer { padding: 0 12px; } 2755 2756&:selected { color: $selected_fg_color; } 2757 2758&:disabled { color: $insensitive_fg_color; } 2759 2760image.sidebar-icon { 2761opacity: $hint_opacity; // dim the device icons 2762 2763&:dir(ltr) { padding-right: 8px; } 2764&:dir(rtl) { padding-left: 8px; } 2765} 2766 2767label.sidebar-label { 2768&:dir(ltr) { padding-right: 2px; } 2769&:dir(rtl) { padding-left: 2px; } 2770} 2771 2772@at-root button.sidebar-button { 2773@extend %button_basic.flat; 2774 2775min-height: $small_size; 2776min-width: $small_size; 2777margin-top: 0; 2778margin-bottom: 0; 2779padding: 0; 2780border-radius: 100%; 2781-gtk-outline-radius: 100%; 2782 2783row:selected & { @extend %button_selected.flat; } 2784} 2785 2786&.sidebar-placeholder-row { 2787min-height: 2px; 2788padding: 0 8px; 2789background-image: image($accent_bg_color); 2790background-clip: content-box; 2791} 2792 2793&.sidebar-new-bookmark-row { color: $accent_bg_color; } 2794 2795&:drop(active):not(:disabled) { 2796box-shadow: inset 0 0 0 2px $accent_bg_color; 2797 2798&:selected { 2799// background-color: $accent_bg_color; 2800// color: $selected_fg_color; 2801} 2802} 2803} 2804} 2805 2806placesview { 2807.server-list-button > image { -gtk-icon-transform: rotate(0turn); } 2808 2809.server-list-button:checked > image { -gtk-icon-transform: rotate(-0.5turn); } 2810 2811// this selects the "connect to server" label 2812> actionbar > revealer > box > label { 2813padding-left: 8px; 2814padding-right: 8px; 2815} 2816} 2817 2818 2819/********* 2820* Paned * 2821*********/ 2822paned { 2823> separator { 2824min-width: 1px; 2825min-height: 1px; 2826-gtk-icon-source: none; // defeats the ugly default handle decoration 2827border-style: none; // just to be sure 2828background-color: transparent; 2829// workaround, using background istead of a border since the border will get rendered twice (?) 2830background-image: image($borders_color); 2831background-size: 1px 1px; 2832 2833&.wide { 2834min-width: 6px; 2835min-height: 6px; 2836background-color: $bg_color; 2837background-image: image($borders_color), image($borders_color); 2838background-size: 1px 1px, 1px 1px; 2839} 2840} 2841 2842&.horizontal > separator { 2843background-repeat: repeat-y; 2844 2845&:dir(ltr) { 2846margin: 0 -8px 0 0; 2847padding: 0 8px 0 0; 2848background-position: left; 2849} 2850 2851&:dir(rtl) { 2852margin: 0 0 0 -8px; 2853padding: 0 0 0 8px; 2854background-position: right; 2855} 2856 2857&.wide { 2858margin: 0; 2859padding: 0; 2860background-repeat: repeat-y, repeat-y; 2861background-position: left, right; 2862} 2863} 2864 2865&.vertical > separator { 2866margin: 0 0 -8px 0; 2867padding: 0 0 8px 0; 2868background-repeat: repeat-x; 2869background-position: top; 2870 2871&.wide { 2872margin: 0; 2873padding: 0; 2874background-repeat: repeat-x, repeat-x; 2875background-position: bottom, top; 2876} 2877} 2878} 2879 2880 2881/************** 2882* GtkInfoBar * 2883**************/ 2884infobar { border-style: none; } 2885 2886.info { background-color: $info_bg_color; } 2887 2888.question { background-color: $question_bg_color; } 2889 2890.warning { background-color: $warning_bg_color; } 2891 2892.error { background-color: $error_bg_color; } 2893 2894.info, 2895.question, 2896.warning, 2897.error { 2898color: $selected_fg_color; 2899 2900button { @extend %button_selected; } 2901 2902label:selected { 2903} 2904 2905*:link { @extend %link_selected; } 2906} 2907 2908 2909/************ 2910* Tooltips * 2911************/ 2912tooltip { 2913&.background { 2914// background-color needs to be set this way otherwise it gets drawn twice 2915// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. 2916background-color: scale-alpha($base_color, $higher_opacity); 2917} 2918 2919// @extend %osd; 2920 2921// padding: 4px; /* not working */ 2922border-radius: 2px; 2923box-shadow: none; // otherwise it gets inherited by windowframe.csd 2924 2925// FIXME: we need a border or tooltips vanish on black background. 2926decoration { background-color: transparent; } 2927 2928label { 2929min-height: 32px - 6px * 2; 2930padding: 2px 8px - 6px; 2931} 2932 2933* { // Yeah this is ugly 2934padding: 0; 2935background-color: transparent; 2936color: inherit; 2937} 2938} 2939 2940 2941/***************** 2942* Color Chooser * 2943*****************/ 2944colorswatch { 2945// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one 2946// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is 2947// applied to the overlay box. 2948 2949// base color corners rounding 2950// to avoid the artifacts caused by rounded corner anti-aliasing the base color 2951// sports a bigger radius. 2952// nth-child is needed by the custom color strip. 2953 2954&.top { 2955border-top-left-radius: $material_radius + 0.5px; 2956border-top-right-radius: $material_radius + 0.5px; 2957 2958overlay { 2959border-top-left-radius: $material_radius; 2960border-top-right-radius: $material_radius; 2961} 2962} 2963 2964&.bottom { 2965border-bottom-left-radius: $material_radius + 0.5px; 2966border-bottom-right-radius: $material_radius + 0.5px; 2967 2968overlay { 2969border-bottom-left-radius: $material_radius; 2970border-bottom-right-radius: $material_radius; 2971} 2972} 2973 2974&.left, 2975&:first-child:not(.top) { 2976border-top-left-radius: $material_radius + 0.5px; 2977border-bottom-left-radius: $material_radius + 0.5px; 2978 2979overlay { 2980border-top-left-radius: $material_radius; 2981border-bottom-left-radius: $material_radius; 2982} 2983} 2984 2985&.right, 2986&:last-child:not(.bottom) { 2987border-top-right-radius: $material_radius + 0.5px; 2988border-bottom-right-radius: $material_radius + 0.5px; 2989 2990overlay { 2991border-top-right-radius: $material_radius; 2992border-bottom-right-radius: $material_radius; 2993} 2994} 2995 2996&.dark overlay { color: white; } 2997 2998&.light overlay { color: scale-alpha(black, 0.8); } 2999 3000&.dark { color: white; } // for focus ring 3001 3002&.light { color: scale-alpha(black, 0.8); } // for focus ring 3003 3004&:drop(active) { 3005box-shadow: none; 3006 3007&.light overlay { 3008box-shadow: $z-depth-1, 0 0 0 2px $accent_bg_color; 3009} 3010 3011&.dark overlay { 3012box-shadow: $z-depth-1, 0 0 0 2px $accent_bg_color; 3013} 3014} 3015 3016overlay { 3017transition: $shadow_transition; 3018box-shadow: $z-depth-1; 3019 3020&:hover { box-shadow: $z-depth-2; } 3021} 3022 3023&#add-color-button { 3024border-radius: $material_radius $material_radius 0 0; 3025color: white; // for focus ring 3026 3027&:only-child { border-radius: $material_radius; } 3028 3029overlay { 3030background-image: linear-gradient(to right, 3031$error_bg_color 25%, 3032$warning_bg_color 25%, $warning_bg_color 50%, 3033$info_bg_color 50%, $info_bg_color 75%, 3034$question_bg_color 75%); 3035color: white; 3036} 3037} 3038 3039&:disabled { 3040opacity: $disabled_opacity; 3041 3042overlay { box-shadow: none; } 3043} 3044 3045row:selected & { 3046} 3047 3048&#editor-color-sample { 3049border-radius: $material_radius + 0.5px; 3050 3051overlay { border-radius: $material_radius; } 3052 3053// overlay:hover { box-shadow: $z-depth-1; } 3054} 3055} 3056 3057// colorscale popup 3058colorchooser .popover.osd { 3059transition: $shadow_transition; 3060border-radius: 2px; 3061box-shadow: $z-depth-2; 3062background-color: $base_color; 3063 3064&:backdrop { box-shadow: $z-depth-1; } 3065 3066spinbutton:not(.vertical) { @extend %entry.flat; } 3067} 3068 3069 3070/******** 3071* Misc * 3072********/ 3073//content view (grid/list) 3074.content-view { 3075background-color: $bg_color; 3076 3077// &:hover { -gtk-icon-effect: highlight; } 3078 3079rubberband { @extend rubberband; } 3080} 3081 3082.scale-popup { 3083.osd & { @extend %osd; } 3084 3085.osd & button.flat { //FIXME: quick hack, redo properly 3086} 3087 3088button { // +/- buttons on GtkVolumeButton popup 3089} 3090} 3091 3092 3093/********************** 3094* Window Decorations * 3095*********************/ 3096decoration { 3097transition: $shadow_transition; 3098border-radius: 2px 2px 0 0; 3099box-shadow: $z-depth-4, 0 16px 16px transparent; 3100 3101// FIXME rationalize shadows 3102 3103// this is used for the resize cursor area 3104margin: 8px; 3105 3106&:backdrop { 3107// the transparent shadow here is to enforce that the shadow extents don't 3108// change when we go to backdrop, to prevent jumping windows. 3109// The biggest shadow should be in the same order then in the active state 3110// or the jumping will happen during the transition. 3111box-shadow: $z-depth-2, 0 16px 16px transparent; 3112} 3113 3114.fullscreen &, 3115.tiled & { border-radius: 0; } 3116 3117.popup & { box-shadow: none; } 3118 3119// server-side decorations as used by mutter 3120.ssd & { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16); } //just doing borders, wm draws actual shadows 3121 3122.csd.popup & { 3123border-radius: 2px; 3124box-shadow: $z-depth-2; 3125} 3126 3127tooltip.csd & { 3128border-radius: 2px; 3129box-shadow: $z-depth-2; 3130} 3131 3132messagedialog.csd & { 3133border-radius: 2px; 3134// box-shadow: $z-depth-4, 0 16px 16px transparent; 3135 3136// &:backdrop { box-shadow: $z-depth-2, 0 16px 16px transparent; } 3137} 3138 3139.solid-csd & { 3140margin: 4px; 3141// border: solid 1px $borders_color; 3142border-radius: 0; 3143box-shadow: none; 3144background-color: $bg_color; 3145} 3146} 3147 3148// Window Close button 3149button.titlebutton { 3150// @extend %button_basic.flat; 3151 3152@extend %button_basic.image-button; 3153 3154.selection-mode & { 3155} 3156} 3157 3158 3159// catch all extend :) 3160 3161%selected_items { 3162background-color: $selected_bg_color; 3163 3164@at-root %nobg_selected_items, & { 3165color: $selected_fg_color; 3166 3167&:disabled { color: $insensitive_selected_fg_color; } 3168} 3169} 3170 3171.monospace { font: Monospace; } 3172 3173 3174/********************** 3175* Touch Copy & Paste * 3176*********************/ 3177//touch selection handlebars for the Popover.osd above 3178cursor-handle { 3179border-radius: 100px; 3180background-color: $accent_bg_color; 3181background-image: none; 3182 3183&.top:dir(ltr), &.bottom:dir(rtl) { 3184padding-left: 6px; 3185border-top-right-radius: 0; 3186} 3187 3188&.bottom:dir(ltr), &.top:dir(rtl) { 3189padding-right: 6px; 3190border-top-left-radius: 0; 3191} 3192 3193&.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) { 3194-GtkWidget-text-handle-width: 24; 3195-GtkWidget-text-handle-height: 30; 3196 3197$_url: 'assets/slider-horz-scale-has-marks-above#{$asset_suffix}'; 3198-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 3199url('#{$_url}@2.png')); 3200} 3201} 3202 3203.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview 3204 3205button.circular { // FIXME: aggregate to buttons 3206border-radius: 100px; 3207-gtk-outline-radius: 100px; 3208 3209label { padding: 0; } 3210} 3211 3212// shortcut window keys 3213.keycap { 3214min-width: 28px - 8px * 2; 3215min-height: 28px - 2px; 3216margin-top: 2px; 3217padding-bottom: 2px; 3218padding-left: 8px; 3219padding-right: 8px; 3220 3221border: solid 1px $borders_color; 3222border-radius: 2px + 1px; 3223box-shadow: inset 0 -2px $borders_color; 3224background-color: $base_color; 3225color: $fg_color; 3226font-size: smaller; 3227} 3228 3229*:drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die 3230transition: $material_transition; 3231box-shadow: $z-depth-1, inset 0 0 0 2px $accent_bg_color; 3232caret-color: $accent_bg_color; 3233} 3234 3235stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons 3236 3237stackswitcher button.circular, 3238stackswitcher button.text-button.circular { // FIXME aggregate with buttons 3239min-width: $medium_size; 3240min-height: $medium_size; 3241padding: 0; 3242} 3243