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