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