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