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