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