_common.scss
Unicode text, UTF-8 text
1$asset_suffix: if($variant=='dark', '-dark', ''); 2 3* { 4padding: 0; 5background-clip: padding-box; 6// transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 7transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0; //FIXME: 8-GtkToolButton-icon-spacing: 4; 9-GtkTextView-error-underline-color: $error_color; 10 11-GtkCheckButton-indicator-size: 20; 12-GtkCheckMenuItem-indicator-size: 16; 13 14// The size for scrollbars. The slider is 2px smaller, but we keep it 15// up so that the whole area is sensitive to button presses for the 16// slider. The stepper button is larger in both directions, the slider 17// only in the width 18 19-GtkScrolledWindow-scrollbar-spacing: 0; 20-GtkScrolledWindow-scrollbars-within-bevel: 1; 21 22-GtkToolItemGroup-expander-size: 11; 23-GtkExpander-expander-size: 16; 24-GtkTreeView-expander-size: 11; 25 26-GtkTreeView-horizontal-separator: 4; 27 28-GtkMenu-horizontal-padding: 0; 29-GtkMenu-vertical-padding: 0; 30 31-GtkWidget-link-color: $link_color; 32-GtkWidget-visited-link-color: $link_visited_color; 33 34-GtkWidget-focus-padding: 2; // FIXME: do we still need these? 35-GtkWidget-focus-line-width: 1; // 36 37-GtkWidget-text-handle-width: 20; 38-GtkWidget-text-handle-height: 20; 39 40-GtkDialog-button-spacing: 4; 41-GtkDialog-action-area-border: 0; 42 43-GtkStatusbar-shadow-type: none; 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; 53outline-radius: 2px; 54} 55 56 57/*************** 58* Base States * 59***************/ 60 61.background { 62background-color: $bg_color; 63color: $fg_color; 64 65&:backdrop { 66// color: $backdrop_fg_color; 67} 68} 69 70/* 71These wildcard seems unavoidable, need to investigate. 72Wildcards are bad and troublesome, use them with care, 73or better, just don't. 74Everytime a wildcard is used a kitten dies, painfully. 75*/ 76 77*:insensitive { 78-gtk-image-effect: dim; 79} 80 81.gtkstyle-fallback { 82background-color: $bg_color; 83color: $fg_color; 84&:prelight { 85background-color: darken($bg_color, 5%); 86color: $fg_color; 87} 88&:active { 89background-color: darken($bg_color, 10%); 90color: $fg_color; 91} 92&:insensitive { 93background-color: $bg_color; 94color: $insensitive_fg_color; 95} 96&:selected { 97background-color: $selected_bg_color; 98color: $selected_fg_color; 99} 100} 101 102.view { 103@extend .list-row.activatable; 104background-color: $base_color; 105color: $fg_color; 106 107&:hover, &:active, &:selected { border-radius: 2px; } 108 109&:insensitive { 110// background-color: $secondary_base_color; 111color: $insensitive_fg_color; 112} 113 114&:backdrop { 115// color: $backdrop_fg_color; 116} 117 118&:selected { @extend %selected_items; } 119} 120 121.rubberband { 122border: 1px solid $secondary_selected_bg_color; 123background-color: gtkopacity($secondary_selected_bg_color, 0.2); 124} 125 126.label { 127&.separator { 128color: $fg_color; 129@extend .dim-label; 130// &:backdrop { color: $backdrop_fg_color; } 131} 132&:selected { 133@extend %selected_items; 134} 135&:insensitive { 136color: $insensitive_fg_color; 137// &:backdrop { color: $backdrop_insensitive_fg_color; } 138} 139} 140 141.dim-label { 142opacity: 0.6; 143} 144 145GtkAssistant { 146.sidebar { 147padding: 6px 0; 148border-top: 1px solid $borders_color; 149&:dir(ltr) { border-right: 1px solid $borders_color; } 150&:dir(rtl) { border-left: 1px solid $borders_color; } 151} 152&.csd .sidebar { border-top-style: none; } 153.sidebar .label { 154opacity: 0.75; 155padding: 5px 12px 6px; 156font-weight: bold; 157} 158.sidebar .label.highlight { 159opacity: 1; 160} 161} 162 163GtkTextView { // This will get overridden by .view, needed by gedit line numbers 164background-color: $secondary_base_color; 165} 166 167.grid-child { 168// outline-offset: -2px; 169padding: 4px; 170border-radius: 2px; 171&:selected { @extend %selected_items; } 172} 173 174%osd, .osd { opacity: 0.9; } 175 176/********************* 177* Spinner Animation * 178*********************/ 179 180@keyframes spin { 181to { -gtk-icon-transform: rotate(1turn); } 182} 183 184.spinner { 185background-color: blue; 186background-image: none; 187opacity: 0; // non spinning spinner makes no sense 188-gtk-icon-source: -gtk-icontheme('process-working-symbolic'); 189&:active { 190opacity: 1; 191animation: spin 1s linear infinite; 192&:insensitive { 193opacity: 0.4; 194} 195} 196} 197 198/**************** 199* Text Entries * 200****************/ 201 202.entry { 203padding: 7px 8px 8px; 204border-radius: 2px; 205@include entry(normal); 206&:focus { @include entry(focus); } 207&:insensitive { @include entry(insensitive); } 208&.flat { 209border-radius: 0; 210@include entry(flat); 211&:focus { @include entry(flat-focus); } 212&:insensitive { @include entry(flat-insensitive); } 213} 214 215&:selected { @extend %selected_items; } 216 217&.image { // icons inside the entry 218&.left { padding-left: 2px; } 219&.right { padding-right: 2px; } 220} 221 222&.progressbar { 223margin: 2px; 224border-style: none none solid; 225border-width: 2px; 226border-color: $selected_bg_color; 227border-radius: 0; 228box-shadow: none; 229background-color: transparent; 230background-image: none; 231} 232 233.linked > &:not(.flat) { @extend %linked; } 234 235.linked.vertical > &:not(.flat) { @extend %linked_vertical; } 236 237// entry error and warning style 238@each $e_type, $e_color in (error, $error_color), 239(warning, $warning_color) { 240&.#{$e_type} { 241@include entry(normal, $e_color); 242&:focus { @include entry(focus, $e_color); } 243&:insensitive { @include entry(insensitive, $e_color); } 244&.flat { 245@include entry(flat, $e_color); 246&:focus { @include entry(flat-focus, $e_color); } 247&:insensitive { @include entry(flat-insensitive, $e_color); } 248} 249} 250} 251 252&.image { // entry icons colors 253&:not(:hover):not(:active) { color: gtkalpha(currentColor, 0.75); } 254&:insensitive { color: gtkalpha(currentColor, 0.6); } 255} 256 257.osd & { 258} 259} 260 261 262/*********** 263* Buttons * 264***********/ 265 266// stuff for .needs-attention 267@keyframes needs_attention { 268from { 269background-image: -gtk-gradient(radial, 270center center, 0, 271center center, 0.001, 272to($selected_bg_color), 273to(transparent)); 274} 275to { 276background-image: -gtk-gradient(radial, 277center center, 0, 278center center, 0.5, 279to($selected_bg_color), 280to(transparent)); 281} 282} 283 284 285.button { 286padding: 7px 10px 8px; 287border-radius: 2px; 288background-repeat: no-repeat; 289background-position: center, center; 290background-size: 36px * 2 / 0.8 36px * 2 / 0.8, auto; 291font-weight: 500; 292@include button(normal); 293&:hover { @include button(hover); } 294&:active { @include button(active); } 295&:insensitive { @include button(insensitive); } 296&:checked { @include button(checked); } 297&:checked:insensitive { @include button(checked-insensitive); } 298&.flat { 299@include button(flat); 300&:hover { @include button(flat-hover); } 301&:active { @include button(flat-active); } 302&:insensitive { @include button(flat-insensitive); } 303&:checked { @include button(flat-checked); } 304&:checked:insensitive { @include button(flat-checked-insensitive); } 305.linked > & { 306border-radius: 2px; 307&.image-button { 308outline-radius: 100px; 309border-radius: 100px; 310} 311} 312} 313// big standalone buttons like in Documents pager 314&.osd { 315&.image-button { padding: 16px; } 316&:insensitive { opacity: 0; } 317} 318//overlay / OSD style 319.osd & { 320} 321 322// Suggested and Destructive Action buttons 323@each $b_type, $b_color in (suggested-action, $suggested_color), 324(destructive-action, $destructive_color) { 325&.#{$b_type} { 326background-color: $b_color; 327color: $selected_fg_color; 328// @include button(normal, $b_color, white); 329// &:hover { @include button(hover, $b_color, white); } 330// &:active, &:checked { @include button(active, $b_color, white); } 331&:insensitive { @include button(insensitive, $b_color, white); } 332&:checked { background-color: mix($selected_fg_color, $b_color, 20%); } 333&.flat { 334background-color: transparent; 335color: $b_color; 336// @include button(flat, $b_color, white); 337// &:hover { @include button(flat-hover, $b_color, white); } 338// &:active, &:checked { @include button(flat-active, $b_color, white); } 339&:insensitive { @include button(flat-insensitive, $b_color, white); } 340} 341} 342} 343 344&.image-button { @extend %image_button; } 345 346&.text-button { 347padding-left: 16px; 348padding-right: 16px; 349} 350 351&.text-button.image-button { 352// those buttons needs uneven horizontal padding, we want the icon side 353// to have the image-button padding, while the text side the text-button 354// one, so we're adding the missing padding to the label depending on 355// its position inside the button 356padding: 7px 10px 8px; // same as .button 357outline-radius: 2px; 358border-radius: 2px; 359background-size: 36px * 2 / 0.8 36px * 2 / 0.8, auto; 360.label:first-child { padding-left: 6px; } 361.label:last-child { padding-right: 6px; } 362} 363 364.stack-switcher > & { 365// to position the needs attention dot, padding is added to the button 366// child, a label needs just lateral padding while an icon needs vertical 367// padding added too. 368 369outline-offset: -4px; // needs to be set or it gets overriden by GtkRadioButton outline-offset 370 371> .label { 372padding-left: 6px; // label padding 373padding-right: 6px; // 374} 375> GtkImage { 376padding-left: 6px; // image padding 377padding-right: 6px; // 378padding-top: 3px; // 379padding-bottom: 3px; // 380} 381&.text-button { 382padding: 7px 10px 8px; // needed or it will get overridden 383} 384&.image-button { 385// we want image buttons to have a 1:1 aspect ratio, so compensation 386// of the padding added to the GtkImage is needed 387padding: 7px 4px; 388} 389&.needs-attention > .label, 390&.needs-attention > GtkImage { @extend %needs_attention; } 391&.needs-attention:checked > .label, 392&.needs-attention:checked > GtkImage { 393animation: none; 394background-image: none; 395} 396} 397 398//inline-toolbar buttons 399.inline-toolbar & { 400@extend .button.flat; 401@extend %image_button; 402} 403 404.primary-toolbar & { icon-shadow: none; } // tango icons don't need shadows 405 406.linked > &:not(.flat):not(:only-child) { @extend %linked; } 407 408.linked.vertical > &:not(.flat):not(:only-child) { @extend %linked_vertical; } 409} 410 411%image_button { 412padding: 10px; 413outline-radius: 100px; 414border-radius: 100px; 415background-size: 36px * 1 / 0.8 36px * 1 / 0.8, auto; 416} 417 418%needs_attention { 419transition: none; 420animation: needs_attention 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; 421background-repeat: no-repeat; 422background-position: right 3px; 423background-size: 6px 6px; 424&:dir(rtl) { background-position: left 3px; } 425} 426 427 428// all the following is for the +|- buttons on inline toolbars, that way 429// should really be deprecated... 430.inline-toolbar GtkToolButton > .button { // redefining the button look is 431// needed since those are flat... 432} 433 434// More inline toolbar buttons 435.inline-toolbar.toolbar GtkToolButton { 436// & > .button.flat { @extend %linked_middle; } 437// &:first-child > .button.flat { @extend %linked:first-child; } 438// &:last-child > .button.flat { @extend %linked:last-child; } 439// &:only-child > .button.flat { @extend %linked:only-child; } 440} 441 442%linked_middle { 443border-radius: 0; 444} 445 446%linked { 447outline-radius: 2px; 448@extend %linked_middle; 449&:first-child { 450border-top-left-radius: 2px; 451border-bottom-left-radius: 2px; 452} 453&:last-child { 454border-top-right-radius: 2px; 455border-bottom-right-radius: 2px; 456} 457&:only-child { 458border-radius: 2px; 459} 460} 461 462%linked_vertical_middle { 463border-radius: 0; 464} 465 466%linked_vertical{ 467outline-radius: 2px; 468@extend %linked_vertical_middle; 469&:first-child { 470border-top-left-radius: 2px; 471border-top-right-radius: 2px; 472} 473&:last-child { 474border-bottom-left-radius: 2px; 475border-bottom-right-radius: 2px; 476} 477&:only-child { 478border-radius: 2px; 479} 480} 481 482/* menu buttons */ 483.menuitem.button.flat { 484&:selected { @extend %selected_items; } 485} 486 487 488GtkColorButton.button { 489padding: 7px 8px 8px; // Uniform padding on the GtkColorButton 490 491GtkColorSwatch:first-child:last-child { // :first-child:last-child for a specificity bump, it gets overridden by the 492// colorpicker style, otherwise 493border-radius: 2px; 494box-shadow: $z-depth-1; 495} 496} 497 498/********* 499* Links * 500*********/ 501 502*:link { 503color: $link_color; 504&:hover, &:active { color: $link_color; } 505&:visited { 506color: $link_visited_color; 507&:hover, &:active { color: $link_visited_color; } 508*:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); } 509} 510&:selected, *:selected & { 511color: mix($selected_fg_color, $selected_bg_color, 80%); 512} 513} 514 515.button:link, .button:visited { 516@extend *:link; 517& > .label { 518text-decoration-line: underline; 519} 520} 521 522/***************** 523* GtkSpinButton * 524*****************/ 525 526.spinbutton { 527.button { 528padding: 4px; 529border: solid 6px transparent; 530@extend %image_button; 531// @extend .button.flat; 532@include button(flat); 533&:hover { @include button(flat-hover); } 534&:active { @include button(flat-active); } 535&:insensitive { @include button(flat-insensitive); } 536} 537.osd & { 538.button { 539} 540} 541&.vertical { //FIXME: try using linking templates for vertically linked stuff 542.button { 543padding-top: 10px; // Same vertical padding as image-buttons 544padding-bottom: 10px; // 545border: none; 546&:first-child { 547border-radius: 2px 2px 0 0; 548} 549&:last-child { 550border-radius: 0 0 2px 2px; 551} 552} 553&.entry { 554} 555} 556GtkTreeView & { 557&.entry, &.entry:focus { 558// padding: 1px; 559// border-width: 1px 0; 560// border-color: $selected_bg_color; 561// border-radius: 0; 562// box-shadow: none; 563} 564} 565} 566 567/************** 568* ComboBoxes * 569**************/ 570GtkComboBox { 571> .the-button-in-the-combobox { padding: 5px 6px 6px; } // Otherwise combos 572// are bigger then 573// buttons 574-GtkComboBox-arrow-scaling: 0.5; 575-GtkComboBox-shadow-type: none; 576 577.menu .menuitem { padding: 5px 6px 6px; } 578.separator.vertical { 579// always disable separators 580-GtkWidget-wide-separators: true; 581} 582&.combobox-entry .entry { 583&:dir(ltr) { 584border-top-right-radius: 0; 585border-bottom-right-radius: 0; 586} 587&:dir(rtl) { 588border-top-left-radius: 0; 589border-bottom-left-radius: 0; 590} 591} 592&.combobox-entry .button { 593padding: 10px; 594&:dir(ltr) { 595border-top-left-radius: 0; 596border-bottom-left-radius: 0; 597} 598&:dir(rtl) { 599border-top-right-radius: 0; 600border-bottom-right-radius: 0; 601} 602} 603} 604 605.linked > GtkComboBox > .the-button-in-the-combobox, 606.linked > GtkComboBoxText > .the-button-in-the-combobox { 607// the combo is a composite widget so the way we do button linkind doesn't 608// work, special case needed. See 609// https://bugzilla.gnome.org/show_bug.cgi?id=733979 610&:dir(ltr), 611&:dir(rtl) { @extend %linked_middle; } // specificity bump 612} 613.linked > GtkComboBox:first-child > .the-button-in-the-combobox, 614.linked > GtkComboBoxText:first-child > .the-button-in-the-combobox { 615@extend %linked:first-child; 616} 617.linked > GtkComboBox:last-child > .the-button-in-the-combobox, 618.linked > GtkComboBoxText:last-child > .the-button-in-the-combobox { 619@extend %linked:last-child; 620} 621.linked > GtkComboBox:only-child > .the-button-in-the-combobox, 622.linked > GtkComboBoxText:only-child > .the-button-in-the-combobox { 623@extend %linked:only-child; 624} 625 626.linked.vertical > GtkComboBoxText > .the-button-in-the-combobox, 627.linked.vertical > GtkComboBox > .the-button-in-the-combobox { @extend %linked_vertical_middle; } 628.linked.vertical > GtkComboBoxText:first-child > .the-button-in-the-combobox, 629.linked.vertical > GtkComboBox:first-child > .the-button-in-the-combobox { @extend %linked_vertical:first-child; } 630.linked.vertical > GtkComboBoxText:last-child > .the-button-in-the-combobox, 631.linked.vertical > GtkComboBox:last-child > .the-button-in-the-combobox { @extend %linked_vertical:last-child; } 632.linked.vertical > GtkComboBoxText:only-child > .the-button-in-the-combobox, 633.linked.vertical > GtkComboBox:only-child > .the-button-in-the-combobox { @extend %linked_vertical:only-child; } 634 635/************ 636* Toolbars * 637************/ 638.toolbar { 639-GtkWidget-window-dragging: true; 640padding: 4px; 641background-color: $bg_color; 642.osd &, &.osd { 643padding: 6px; 644border-style: solid; 645border-width: 8px; 646border-image: -gtk-scaled(url("assets/osd-shadow#{$asset_suffix}.png"), 647url("assets/osd-shadow#{$asset_suffix}@2.png")) 64810 / 10px stretch; 649border-radius: 2px; 650// box-shadow: $z-depth-2; 651background-color: $base_color; 652&:backdrop { 653border-image: -gtk-scaled(url("assets/osd-shadow-backdrop#{$asset_suffix}.png"), 654url("assets/osd-shadow-backdrop#{$asset_suffix}@2.png")) 65510 / 10px stretch; 656// box-shadow: $z-depth-1; 657} 658& .button { 659@extend .button.flat; 660} 661} 662} 663 664//searchbar, location-bar & inline-toolbar 665.inline-toolbar { 666padding: 6px; 667border-style: solid; 668border-width: 0 1px 1px; 669border-color: $borders_color; 670background-color: $secondary_base_color; 671} 672 673.search-bar, .location-bar { 674padding: 6px; 675border-style: solid; 676border-width: 0 0 1px; 677border-color: $borders_color; 678background-color: $dark_color; 679} 680 681/*************** 682* Header bars * 683***************/ 684 685.titlebar, 686.header-bar { 687padding: 6px; 688border-width: 0 0 1px; 689border-style: solid; 690border-color: $borders_color; 691border-radius: 2px 2px 0 0; 692box-shadow: inset 0 1px $highlight_color; 693background-color: $dark_color; 694background-clip: border-box; 695 696&:backdrop { 697// background-color: $dark_color; 698} 699 700.title { 701padding-left: 12px; 702padding-right: 12px; 703font-weight: bold; 704} 705 706.subtitle { 707@extend .dim-label; 708padding-left: 12px; 709padding-right: 12px; 710font-size: smaller; 711} 712 713.header-bar-separator, 714& > GtkBox > .separator.vertical { 715-GtkWidget-wide-separators: true; 716-GtkWidget-separator-width: 1px; 717border-style: solid; 718border-width: 0 1px; 719border-color: $borders_color; 720} 721 722& .button:not(.suggested-action):not(.destructive-action) { 723@extend .button.flat; 724border-image: -gtk-gradient(radial, 725center bottom, 0, 726center bottom, 0.001, 727to($selected_bg_color), 728to(transparent)) 7290 0 0 / 0 0 0px; 730&:checked { 731border-image: -gtk-gradient(radial, 732center bottom, 0, 733center bottom, 0.5, 734to($selected_bg_color), 735to(transparent)) 7360 0 2 / 0 0 2px; 737// box-shadow: inset 0 -2px $selected_bg_color; 738background-color: transparent; 739color: $fg_color; 740// transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0 cubic-bezier(0.4, 0, 0.2, 1) 0.2s, color 0; 741// &:active { transition: none; } 742&:insensitive { 743background-color: transparent; 744color: $insensitive_fg_color; 745> .label { color: inherit; } 746} 747} 748} 749 750&.selection-mode { 751box-shadow: inset 0 1px gtkopacity(white, 0.2); 752background-color: $selection_color; 753color: $selected_fg_color; 754&:backdrop { 755} 756 757.subtitle:link { @extend *:link:selected; } 758 759.button { 760border-image: -gtk-gradient(radial, 761center bottom, 0, 762center bottom, 0.001, 763to($selected_fg_color), 764to(transparent)) 7650 0 0 / 0 0 0px; 766color: $secondary_selected_fg_color; 767&:hover, &:active, &:checked { 768color: $selected_fg_color; 769} 770 771&:insensitive { 772} 773 774&:checked { 775border-image: -gtk-gradient(radial, 776center bottom, 0, 777center bottom, 0.5, 778to($selected_fg_color), 779to(transparent)) 7800 0 2 / 0 0 2px; 781// box-shadow: inset 0 -2px $selected_fg_color; 782color: $selected_fg_color; 783&:insensitive { 784color: $insensitive_selected_fg_color; 785> .label { color: inherit; } 786} 787} 788&.suggested-action { 789// NOTE: do not use @extend .button; 790@include button(normal); 791&:hover { @include button(hover); } 792&:active { @include button(active); } 793&:insensitive { @include button(insensitive); } 794} 795} 796 797.selection-menu { 798padding-left: 16px; 799padding-right: 16px; 800 801GtkArrow { -GtkArrow-arrow-scaling: 1; } 802 803.arrow { 804-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 805} 806} 807} 808 809.tiled &, .maximized & { 810border-radius: 0; // squared corners when the window is max'd or tiled 811box-shadow: none; 812} 813 814&.default-decoration { 815padding: 4px; 816border-width: 0; 817.button { padding: 6px; } 818} 819} 820 821/************ 822* Pathbars * 823************/ 824 825.path-bar .button { 826padding: 7px 6px 8px; 827&.image-button { padding: 10px; } 828&:only-child { 829padding-left: 16px; 830padding-right: 16px; 831} 832 833// the following is for spacing the icon and the label inside the home button 834.label:last-child { padding-left: 2px; } 835.label:first-child { padding-right: 2px; } 836.label:only-child { padding-right: 0; padding-left: 0; } 837GtkImage { padding-top: 1px; } 838} 839 840/************** 841* Tree Views * 842**************/ 843GtkTreeView.view { 844-GtkTreeView-grid-line-width: 1; 845-GtkTreeView-grid-line-pattern: ''; 846-GtkTreeView-tree-line-width: 1; 847-GtkTreeView-tree-line-pattern: ''; 848-GtkTreeView-expander-size: 16; 849 850border-left-color: $track_color; // this is actually the tree lines color, 851border-top-color: $borders_color; // while this is the grid lines color, better then nothing 852 853&.rubberband { @extend .rubberband; } // to avoid borders being overridden by the previously set props 854 855border-radius: 0; // rest border radius in lists 856 857&:hover, &:active, &:selected { border-radius: 0; } 858 859&.dnd { 860border-style: solid none; 861border-width: 1px; 862border-color: mix($fg_color, $selected_bg_color, 50%); 863} 864 865&.expander { 866-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 867&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } 868&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 869&:selected { 870color: gtkopacity($selected_fg_color, 0.75); 871&:hover, &:active { color: $selected_fg_color; } 872} 873} 874 875&.progressbar { // progress bar in treeviews 876@extend .entry.progressbar; 877border-width: 4px; 878&:selected { 879border-color: currentColor; 880} 881} 882 883&.trough { // progress bar trough in treeviews 884@extend .entry.progressbar; 885border-width: 4px; 886border-color: gtkopacity($selected_bg_color, 0.2); 887&:selected { 888border-color: $track_color; 889} 890} 891} 892 893column-header { 894.button { 895@extend .list-row.activatable; 896padding: 3px 6px 4px; 897border-style: none solid solid none; 898border-width: 1px; 899border-color: $borders_color; 900border-radius: 0; 901box-shadow: none; 902background-color: $base_color; 903// font-weight: bold; 904&:hover, &:active { 905box-shadow: none; 906} 907&:insensitive { 908background-color: $base_color; 909} 910&.dnd { 911@extend column-header.button.dnd; 912} 913} 914&:last-child .button, 915&:last-child.button { //treeview-like derived widgets in Banshee and Evolution 916border-right-style: none; 917} 918} 919 920column-header.button.dnd { // for treeview-like derive widgets 921// transition: none; 922border-left-style: solid; 923color: $selected_bg_color; 924} 925 926 927/********* 928* Menus * 929*********/ 930.menubar { 931-GtkWidget-window-dragging: true; 932padding: 0px; 933box-shadow: inset 0 -1px $borders_color; 934background-color: $dark_color; 935& > .menuitem { 936padding: 4px 8px; 937color: $secondary_fg_color; 938&:hover { //Seems like it :hover even with keyboard focus 939box-shadow: inset 0 -2px $selected_bg_color; 940color: $fg_color; 941} 942&:insensitive { 943color: $insensitive_fg_color; 944box-shadow: none; 945} 946} 947} 948 949.menu { 950margin: 4px; 951padding: 0px; 952background-color: $base_color; 953border: 1px solid $borders_color; // adds borders in a non composited env 954.csd & { border: none; } // axes borders in a composited env 955.menuitem { 956transition-duration: 0.1s; 957padding: 3px 4px 4px; 958font: initial; 959text-shadow: none; 960&:hover { 961transition-duration: 0; 962color: $selected_fg_color; 963background-color: $selected_bg_color; 964} 965&:insensitive { 966color: $insensitive_fg_color; 967} 968//submenu indicators 969&.arrow { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); } 970&.arrow:dir(rtl) {-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); } 971} 972&.button { // overlow buttons 973border-style: none; 974border-radius: 0; 975&.top { border-bottom: 1px solid $borders_color; } 976&.bottom { border-top: 1px solid $borders_color; } 977&:hover { background-color: $track_color; } 978&:insensitive { 979color: transparent; 980background-color: transparent; 981border-color: transparent ; 982} 983} 984} 985 986.menuitem .accelerator { color: gtkalpha(currentColor, 0.6); } 987 988 989/*************** 990* Popovers * 991***************/ 992 993.popover { 994padding: 2px; 995border: 1px solid; 996border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3); 997border-radius: 2px + 1px; 998background-color: $secondary_base_color; 999box-shadow: $z-depth-2; 1000&:backdrop { box-shadow: $z-depth-1; } 1001 1002> .list, 1003> .view, 1004> .toolbar, 1005&.osd > .toolbar { 1006border-style: none; 1007border-image: none; 1008background-color: transparent; 1009} 1010 1011.button.flat { 1012padding: 5px 8px 6px; 1013background-color: transparent; 1014background-size: 128px * 1 / 0.8 128px * 1 / 0.8, auto; 1015color: $fg_color; 1016font: initial; 1017} 1018 1019.linked > .button { 1020border-radius: 2px; 1021// @extend .button.flat; 1022@include button(flat); 1023&:hover { @include button(flat-hover); } 1024&:active { @include button(flat-active); } 1025&:insensitive { @include button(flat-insensitive); } 1026&:checked { @include button(checked); } 1027&:checked:insensitive { @include button(checked-insensitive); } 1028} 1029 1030&.osd { @extend %osd; } 1031} 1032 1033/***************** 1034* Notebooks and * 1035* Tabs * 1036*****************/ 1037 1038.notebook { 1039// Through me you go to the grief wracked city; 1040// Through me you go to everlasting pain; 1041// Through me you go a pass among lost souls. 1042// ... 1043// Abandon all hope — Ye Who Enter Here 1044padding: 0; 1045background-color: $base_color; 1046-GtkNotebook-initial-gap: 6; 1047-GtkNotebook-arrow-spacing: 5; 1048-GtkNotebook-tab-curvature: 0; 1049-GtkNotebook-tab-overlap: 1; 1050-GtkNotebook-has-tab-gap: false; 1051-GtkWidget-focus-padding: 0; 1052-GtkWidget-focus-line-width: 0; 1053&.frame { 1054border: 1px solid $borders_color; 1055// FIXME doesn't work 1056&.top { border-top-width: 0; } 1057&.bottom { border-bottom-width: 0; } 1058&.right { border-right-width: 0; } 1059&.left { border-left-width: 0; } 1060} 1061&.header { 1062// FIXME: double borders in some case, can't fix it w/o a class tho 1063// FIXME: doesn't work on dark var 1064background-color: $dark_color; 1065 1066// this is the shading of the header behind the tabs 1067&.frame { 1068border: 1px solid $borders_color; 1069&.top { border-bottom-width: 0; } 1070&.bottom { border-top-width: 0; } 1071&.right { border-left-width: 0; } 1072&.left { border-right-width: 0; } 1073} 1074 1075&.top { 1076box-shadow: inset 0 -1px $borders_color; // border 1077} 1078&.bottom { 1079box-shadow: inset 0 1px $borders_color; 1080} 1081&.right { 1082box-shadow: inset 1px 0 $borders_color; 1083} 1084&.left { 1085box-shadow: inset -1px 0 $borders_color; 1086} 1087} 1088tab { 1089border-width: 0; 1090border-style: solid; 1091border-color: transparent; 1092background-color: transparent; 1093 1094outline-offset: 0; 1095 1096$tab_indicator_size: 2px; 1097//vertical tab sizing 1098$vt_vpadding: 8px; 1099$vt_hpadding: 20px; 1100// horizontal tab sizing 1101$ht_vpadding: 5px; 1102$ht_hpadding: 20px; 1103 1104//FIXME: we get double border in some cases, not considering the broken 1105//notebook content frame... 1106&.top, &.bottom { padding: $vt_vpadding $vt_hpadding; } 1107&.left, &.right { padding: $ht_vpadding $ht_hpadding; } 1108 1109 1110/* works for testnotebookdnd, but there's a superfluous border 1111in gedit or web, commented out for now, needs gtk fixes 1112&.reorderable-page { 1113&.top { 1114padding-top: ($vt_vpadding - 1px); 1115border-top-width: 1px; 1116border-left-width: 1px; 1117border-right-width: 1px; 1118} 1119&.bottom { 1120padding-bottom: ($vt_vpadding - 1px); 1121border-bottom-width: 1px; 1122border-left-width: 1px; 1123border-right-width: 1px; 1124} 1125&.left { 1126padding-left: ($ht_hpadding - 1px); 1127border-left-width: 1px; 1128border-top-width: 1px; 1129border-bottom-width: 1px; 1130} 1131&.right { 1132padding-right: ($ht_hpadding - 1px); 1133border-right-width: 1px; 1134border-top-width: 1px; 1135border-bottom-width: 1px; 1136} 1137} 1138*/ 1139&.reorderable-page { 1140-GtkNotebook-tab-overlap: 1; 1141&.top, &.bottom { 1142padding-left: 12px; // for a nicer close button 1143padding-right: 12px; // placement 1144border-left-width: 1px; 1145border-right-width: 1px; 1146} 1147&.left, &.right { 1148border-bottom-width: 1px; 1149border-top-width: 1px; 1150} 1151} 1152&.top { 1153//padding-bottom: ($vt_vpadding -$tab_indicator_size); 1154border-bottom-width: $tab_indicator_size; 1155} 1156&.bottom { 1157//padding-top: ($vt_vpadding -$tab_indicator_size); 1158border-top-width: $tab_indicator_size; 1159} 1160&.left { 1161//padding-right: ($ht_hpadding -$tab_indicator_size); 1162border-right-width: $tab_indicator_size; 1163} 1164&.right { 1165//padding-left: ($ht_hpadding -$tab_indicator_size); 1166border-left-width: $tab_indicator_size; 1167} 1168 1169//here's the interesting stuff 1170&:hover, &.prelight-page { 1171border-color: $track_color; 1172} 1173&:active, &.active-page { 1174border-color: $selected_bg_color; 1175} 1176@each $_tab, $_border in (top, bottom), 1177(bottom, top), 1178(left, right), 1179(right, left) { 1180&.reorderable-page.#{$_tab} { 1181border-color: transparent; 1182&:hover, &.prelight-page { 1183border-color: $borders_color; 1184border-#{$_border}-width: 1px; 1185border-#{$_border}-color: transparent; 1186background-color: $bg_color; 1187} 1188&:active, &.active-page { 1189border-color: $borders_color; 1190border-#{$_border}-width: 1px; 1191border-#{$_border}-color: transparent; 1192background-color: $light_color; 1193} 1194} 1195} 1196.label { //tab text 1197padding: 0 2px; // needed for a nicer focus ring 1198font-weight: bold; 1199color: $secondary_fg_color; 1200} 1201.prelight-page .label, .label.prelight-page { 1202// prelight tab text 1203color: $fg_color; 1204} 1205.active-page .label, .label.active-page { 1206// active tab text 1207color: $fg_color; 1208} 1209.button { //tab close button 1210padding: 0; 1211@extend %image_button; 1212background-size: 24px * 1 / 0.8 24px * 1 / 0.8, auto; 1213// @extend .button.flat; 1214@include button(flat); 1215&:hover { @include button(flat-hover); } 1216&:active { @include button(flat-active); } 1217&:insensitive { @include button(flat-insensitive); } 1218& > GtkImage { // this is a hack which makes tabs grow 1219padding: 4px; 1220} 1221} 1222} 1223&.arrow { 1224&:not(:hover):not(:active) { color: gtkalpha(currentColor, 0.75); } 1225&:insensitive { 1226color: $insensitive_fg_color; 1227} 1228} 1229&:not(.reorderable-page) > .entry { 1230@extend .entry.flat; 1231} 1232} 1233 1234/************** 1235* Scrollbars * 1236**************/ 1237 1238$_slider_margin: 4px; 1239$_slider_fine_tune_margin: 6px; 1240 1241.scrollbar { 1242-GtkRange-slider-width: 8 + $_slider_margin * 2 + 1; 1243-GtkRange-trough-border: 0; 1244-GtkScrollbar-has-backward-stepper: false; 1245-GtkScrollbar-has-forward-stepper: false; 1246-GtkScrollbar-min-slider-length: 24 + $_slider_margin * 2; 1247// minimum size for the slider. 1248// sadly can't be in '.slider' 1249// where it belongs 1250-GtkRange-stepper-spacing: 0; 1251-GtkRange-trough-under-steppers: 1; 1252 1253.button { 1254border: none; 1255} 1256 1257&.overlay-indicator { 1258&:not(.dragging):not(.hovering) { // Overlay scrolling indicator 1259-GtkRange-slider-width: 12px; 1260 1261.slider { 1262margin: 2px; 1263border: 2px solid gtkopacity($base_color, 0.2); 1264// background-clip: padding-box; 1265} 1266 1267.trough { 1268border-style: none; 1269background-color: transparent; 1270} 1271 1272// w/o the following margin tweaks the slider shrinks when hovering/dragging 1273&.vertical .slider { 1274// margin-top: $_slider_margin - 1px; 1275// margin-bottom: $_slider_margin - 1px; 1276} 1277 1278&.horizontal .slider { 1279// margin-left: $_slider_margin - 1px; 1280// margin-right: $_slider_margin - 1px; 1281} 1282 1283} 1284 1285&.dragging, 1286&.hovering { 1287.trough { 1288background-color: gtkopacity($base_color, 0.8); 1289} 1290} 1291} 1292 1293// trough coloring 1294.trough { 1295background-color: $base_color; 1296border: 1px none $borders_color; 1297} 1298 1299// slider coloring 1300.slider { 1301background-color: $tertiary_fg_color; 1302&:hover { background-color: $secondary_fg_color; } 1303&:active { background-color: $fg_color; } 1304&:insensitive { 1305opacity: 0.4; 1306} 1307} 1308 1309 1310// sizing 1311.slider { 1312border-radius: 100px; 1313margin: $_slider_margin; 1314} 1315 1316&.fine-tune .slider { margin: $_slider_fine_tune_margin; } 1317 1318&.vertical { 1319 1320.slider { 1321margin-left: 1px + $_slider_margin; 1322 1323&:dir(rtl) { 1324margin-left: $_slider_margin; 1325margin-right: 1px + $_slider_margin; 1326} 1327} 1328 1329&.fine-tune .slider { 1330margin-left: 1px + $_slider_fine_tune_margin; 1331 1332&:dir(rtl) { 1333margin-left: $_slider_fine_tune_margin; 1334margin-right: 1px + $_slider_fine_tune_margin; 1335} 1336} 1337 1338.trough { 1339border-left-style: solid; 1340 1341&:dir(rtl) { 1342border-left-style: none; 1343border-right-style: solid; 1344} 1345} 1346} 1347 1348&.horizontal { 1349 1350.slider { margin-top: 1px + $_slider_margin; } 1351 1352&.fine-tune .slider { margin-top: 1px + $_slider_fine_tune_margin; } 1353 1354.trough { border-top-style: solid; } 1355} 1356} 1357 1358.scrollbars-junction, 1359.scrollbars-junction.frame { // the small square between two scrollbars 1360border-style: solid none none solid; 1361background-color: $base_color; 1362 1363&:dir(rtl) { border-style: solid solid none none; } 1364} 1365 1366 1367/********** 1368* Switch * 1369**********/ 1370 1371GtkSwitch { 1372-GtkSwitch-slider-width: 28px; // 55px is the right value to make it as tall 1373// as buttons, not doing that for now 1374-GtkSwitch-slider-height: 28px; 1375 1376outline-offset: -4px; 1377outline-radius: 100px; 1378font-size: 0; 1379&.trough { 1380// similar to the .scale 1381border: 10px solid transparent; 1382border-radius: 100px; 1383background-color: $track_color; 1384&:insensitive { 1385color: $insensitive_fg_color; 1386} 1387&:active { 1388background-color: $success_color; 1389&:insensitive { 1390background-color: $track_color; 1391color: $success_color; 1392} 1393} 1394} 1395&.slider { 1396padding: 4px; 1397border-radius: 100px; 1398@include entry(normal); 1399&:hover { @include entry(focus); } 1400&:insensitive { @include entry(insensitive); } 1401} 1402.list-row:selected & { 1403} 1404 1405} 1406 1407/************************* 1408* Check and Radio items * 1409*************************/ 1410 1411// draw regular check and radio items using our PNG assets 1412// all assets are rendered from assets.svg. never add pngs directly 1413 1414@each $w,$a in ('check', 'checkbox'), 1415('radio','radio') { 1416 1417//standard checks and radios 1418@each $s,$as in ('','-unchecked'), 1419(':active', '-unchecked-active'), 1420(':insensitive','-unchecked-insensitive'), 1421(':inconsistent', '-mixed'), 1422(':inconsistent:active', '-mixed-active'), 1423(':inconsistent:insensitive', '-mixed-insensitive'), 1424(':checked', '-checked'), 1425(':checked:active', '-checked-active'), 1426(':checked:insensitive','-checked-insensitive') { 1427.#{$w}#{$s} { 1428-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}#{$asset_suffix}.png"), 1429url("assets/#{$a}#{$as}#{$asset_suffix}@2.png")); 1430icon-shadow: $z-depth-1; 1431&:hover, &:active { icon-shadow: $z-depth-2; } 1432&:insensitive { icon-shadow: none; } 1433&.button.flat { } 1434} 1435} 1436 1437//menu 1438@each $s,$as in ('',''), 1439// (':active', '-checked'), 1440(':insensitive','-insensitive'), 1441(':inconsistent', '-mixed'), 1442// (':inconsistent:active', '-mixed'), 1443(':inconsistent:insensitive', '-mixed-insensitive'), 1444(':checked', '-checked'), 1445// (':checked:active', '-checked'), 1446(':checked:insensitive','-checked-insensitive') { 1447.menu .menuitem.#{$w}#{$s} { 1448// color: gtkalpha(currentColor, 0.75); 1449// -gtk-icon-source: -gtk-icontheme('#{$a}-symbolic'); 1450// &:active, &:checked { -gtk-icon-source: -gtk-icontheme('#{$a}-checked-symbolic'); } 1451// &:inconsistent { -gtk-icon-source: -gtk-icontheme('#{$a}-mixed-symbolic'); } 1452-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}.png"), 1453url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}@2.png")); 1454icon-shadow: none; 1455&:hover { 1456-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic-dark.png"), 1457url("assets/#{$a}#{$as}-symbolic-dark@2.png")); 1458} 1459} 1460} 1461} 1462 1463//treeview and list-rows 1464.view.check, .view.radio, 1465.list-row .check, list-row .radio { 1466} 1467 1468//selection-mode 1469@each $s,$as in ('','-selectionmode'), 1470(':active', '-active-selectionmode'), 1471(':insensitive', '-insensitive-selectionmode'), 1472(':checked', '-checked-selectionmode'), 1473(':checked:active', '-checked-active-selectionmode'), 1474(':insensitive:checked', '-checked-insensitive-selectionmode') { 1475.view.content-view.check#{$s}:not(.list) { 1476-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"), 1477url("assets/checkbox#{$as}@2.png")); 1478background-color: transparent; 1479} 1480} 1481 1482GtkCheckButton.text-button, GtkRadioButton.text-button { 1483// this is for a nice focus on check and radios text 1484padding: 2px 4px; 1485outline-offset: 0; 1486&:insensitive, 1487&:insensitive:active, 1488&:insensitive:inconsistent { 1489// set insensitive color, which is overriden otherwise 1490// color: $insensitive_fg_color; 1491} 1492} 1493 1494/************ 1495* GtkScale * 1496************/ 1497.scale, 1498.scale.scale-has-marks-above.scale-has-marks-below, 1499.scale.vertical.scale-has-marks-above.scale-has-marks-below { 1500// FIXME: rationalize 1501-GtkScale-slider-length: 20; 1502-GtkRange-slider-width: 20; 1503-GtkRange-trough-border: 2; 1504outline-offset: -8px; 1505outline-radius: 100px; 1506 1507&.fine-tune { 1508// outline-offset: -6px; 1509&.slider { background-size: 80%; } 1510&.trough { 1511// margin: 8px; 1512// border-radius: 100px; 1513} 1514} 1515 1516&.slider { 1517&:not(:hover):not(:active) { background-size: 80%; } 1518// @include entry(normal); 1519// border-radius: 50%; 1520// background-color: $success_color; 1521@each $s,$as in ('',''), 1522// (':hover','-hover'), 1523(':active','-active'), 1524(':insensitive','-insensitive') { 1525&.slider#{$s} { 1526$_url: 'assets/slider#{$as}#{$asset_suffix}'; 1527border-style: none; 1528border-radius: 0; 1529background-color: transparent; 1530background-image: -gtk-scaled(url('#{$_url}.png'), 1531url('#{$_url}@2.png')); 1532background-repeat: no-repeat; 1533background-position: center; 1534box-shadow: none; 1535} 1536} 1537&:hover { 1538// @include entry(focus); 1539// border-radius: 50%; // needed for double marks scales 1540} 1541&:insensitive { 1542// @include entry(insensitive); 1543// border-radius: 50%; // overridden 1544} 1545//OSD sliders 1546.osd & { 1547} 1548} 1549&.trough { 1550margin: 10px; 1551border-radius: 100px; 1552background-color: $track_color; 1553&.highlight { 1554background-color: $success_color; 1555&:insensitive { background-color: $track_color; } 1556} 1557&:insensitive { color: $insensitive_fg_color; } 1558//OSD troughs 1559.osd & { 1560} 1561} 1562// marks color 1563&.separator { 1564color: $track_color; 1565} 1566// scales on selected list rows 1567.list-row:selected & { 1568} 1569} 1570 1571@each $d,$dn in ('', 'horz'), 1572('.vertical', 'vert') { 1573@each $w,$we in ('scale-has-marks-below','scale_marks_below'), 1574('scale-has-marks-above','scale_marks_above') { 1575.scale#{$d}.#{$w} { 1576-GtkScale-slider-length: 20; 1577-GtkRange-slider-width: 25; 1578-GtkRange-trough-border: 2; 1579 1580@extend %#{$we}_#{$dn}; 1581 1582@each $s,$as in ('',''), 1583// (':hover','-hover'), 1584(':active','-active'), 1585(':insensitive','-insensitive') { 1586&.slider#{$s} { 1587$_url: 'assets/slider-#{$dn}-#{$w}#{$as}#{$asset_suffix}'; 1588border-style: none; 1589border-radius: 0; 1590background-color: transparent; 1591background-image: -gtk-scaled(url('#{$_url}.png'), 1592url('#{$_url}@2.png')); 1593background-repeat: no-repeat; 1594background-position: center; 1595box-shadow: none; 1596} 1597} 1598} 1599} 1600} 1601 1602%scale_marks_above_horz { 1603.trough { margin: 15px 10px 10px; } 1604// &.fine-tune .trough { margin: 13px 8px 8px; } 1605} 1606%scale_marks_below_horz { 1607.trough { margin: 10px 10px 15px; } 1608// &.fine-tune .trough { margin: 8px 8px 13px; } 1609} 1610%scale_marks_above_vert { 1611.trough { margin: 10px 10px 10px 15px; } 1612// &.fine-tune .trough { margin: 8px 8px 8px 13px; } 1613} 1614%scale_marks_below_vert { 1615.trough { margin: 10px 15px 10px 10px; } 1616// &.fine-tune .trough { margin: 8px 13px 8px 8px; } 1617} 1618 1619/***************** 1620* Progress bars * 1621*****************/ 1622 1623GtkProgressBar { 1624-GtkProgressBar-min-horizontal-bar-height: 4; 1625-GtkProgressBar-min-vertical-bar-width: 4; 1626padding: 0; 1627font-size: smaller; 1628color: $tertiary_fg_color; 1629&.osd { 1630-GtkProgressBar-xspacing: 0; 1631-GtkProgressBar-yspacing: 0; 1632-GtkProgressBar-min-horizontal-bar-height: 4; 1633} 1634&.trough { // background 1635border-radius: 0; 1636background-color: gtkopacity($selected_bg_color, 0.2); 1637&.osd { 1638border-style: none; 1639box-shadow: none; 1640// background-color: transparent; 1641} 1642} 1643} 1644 1645// moving bit 1646.progressbar { 1647border-radius: 0; 1648background-color: $selected_bg_color; 1649&.left { 1650border-top-left-radius: 0; 1651border-bottom-left-radius: 0; 1652} 1653&.right { 1654border-top-right-radius: 0; 1655border-bottom-right-radius: 0; 1656} 1657&.left.right { 1658box-shadow: none; 1659} 1660&.vertical { 1661&.bottom { 1662border-bottom-left-radius: 0; 1663border-bottom-right-radius: 0; 1664box-shadow: none; 1665} 1666&.top { 1667border-top-left-radius: 0; 1668border-top-right-radius: 0; 1669} 1670} 1671&.osd { 1672background-image: none; 1673background-color: $selected_bg_color; 1674border-style: none; 1675border-radius: 0; 1676} 1677} 1678 1679 1680/************* 1681* Level Bar * 1682*************/ 1683 1684.level-bar { 1685box-shadow: $z-depth-1; // needs to be set here to avoid clipping 1686-GtkLevelBar-min-block-width: 36; 1687-GtkLevelBar-min-block-height: 4; 1688&.vertical { 1689-GtkLevelBar-min-block-width: 4; 1690-GtkLevelBar-min-block-height: 36; 1691} 1692&.trough { 1693padding: 2px; 1694border-radius: 2px; 1695@include entry(normal); 1696&:insensitive { @include entry(insensitive); } 1697&.indicator-discrete { 1698&.horizontal { padding: 2px 1px; } 1699&.vertical { padding: 1px 2px; } 1700} 1701} 1702&.fill-block { 1703// FIXME: it would be nice to set make fill blocks bigger, but we'd need 1704// :nth-child working on discrete indicators 1705background-color: $selected_bg_color; 1706border-radius: 0; 1707box-shadow: none; 1708&.indicator-discrete { 1709&.horizontal { margin: 0 1px; } 1710&.vertical { margin: 1px 0; } 1711} 1712&.level-high { 1713background-color: $success_color; 1714} 1715&.level-low { 1716background-color: $warning_color; 1717} 1718&.empty-fill-block { 1719background-color: $track_color; 1720} 1721} 1722} 1723 1724 1725/********** 1726* Frames * 1727**********/ 1728.frame { 1729border: 1px solid $borders_color; 1730&.flat { border-style: none; } 1731padding: 0; 1732&.action-bar { 1733padding: 6px; 1734border-width: 1px 0 0; 1735} 1736} 1737 1738GtkScrolledWindow { 1739GtkViewport.frame { // avoid double borders when viewport inside 1740// scrolled window 1741border-style: none; 1742} 1743} 1744 1745//vbox and hbox separators 1746.separator { 1747// always disable separators 1748// -GtkWidget-wide-separators: true; 1749color: $borders_color; 1750 1751// Font and File button separators 1752GtkFileChooserButton &.vertical, 1753GtkFontButton &.vertical { 1754// always disable separators 1755-GtkWidget-wide-separators: true; 1756} 1757} 1758 1759/********* 1760* Lists * 1761*********/ 1762 1763.list { 1764border-color: $borders_color; 1765background-color: $base_color; 1766} 1767 1768.list-row, 1769.grid-child { 1770padding: 2px; 1771} 1772 1773.list-row.activatable { 1774// let's take care of background colors 1775background-image: -gtk-gradient(radial, 1776center center, 0, 1777center center, 0.5, 1778to(gtkalpha(currentColor, 0)), 1779to(transparent)), 1780linear-gradient(to bottom, gtkalpha(currentColor, 0)); 1781background-repeat: no-repeat; 1782background-position: center, center; 1783background-size: 192px * 1 / 0.8 192px * 1 / 0.8, auto; 1784&:hover { 1785background-image: -gtk-gradient(radial, 1786center center, 0, 1787center center, 0.5, 1788to(gtkalpha(currentColor, 0)), 1789to(transparent)), 1790linear-gradient(to bottom, gtkalpha(currentColor, 0.05)); 1791} 1792&:active { 1793animation: list_ripple_effect 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; 1794} 1795} 1796 1797.list-row:selected { 1798@extend %selected_items; 1799.button { 1800&:insensitive { color: $insensitive_secondary_selected_fg_color; } 1801&.flat { 1802color: $secondary_selected_fg_color; 1803&:hover, &:active { color: $selected_fg_color; } 1804&:insensitive { color: $insensitive_secondary_selected_fg_color; } 1805} 1806} 1807} 1808 1809// transition 1810.list-row { 1811&:hover { transition: none; } 1812} 1813 1814 1815/********************* 1816* App Notifications * 1817*********************/ 1818 1819.app-notification, 1820.app-notification.frame { 1821@extend %osd; 1822@extend .toolbar.osd; 1823.button { 1824} 1825} 1826 1827/************* 1828* Expanders * 1829*************/ 1830 1831.expander { 1832-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1833&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } 1834&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 1835&:not(:hover):not(:active) { color: gtkalpha(currentColor, 0.75); } 1836&:selected { color: $selected_fg_color; } 1837} 1838 1839/************ 1840* Calendar * 1841***********/ 1842GtkCalendar { 1843border: 1px solid $borders_color; 1844color: $fg_color; 1845 1846&:selected { 1847@extend .view:selected; 1848} 1849 1850&.header { 1851border: 1px solid transparent; 1852border-bottom-color: $borders_color; 1853border-radius: 0; 1854} 1855 1856&.button { 1857// @extend .button.flat; 1858@include button(flat); 1859&:hover { @include button(flat-hover); } 1860&:active { @include button(flat-active); } 1861&:insensitive { @include button(flat-insensitive); } 1862} 1863 1864&:inconsistent { color: gtkalpha(currentColor, 0.6); } 1865&.highlight { 1866font-size: smaller; 1867color: gtkalpha(currentColor, 0.6); 1868} 1869} 1870 1871/*********** 1872* Dialogs * 1873***********/ 1874 1875.message-dialog .dialog-action-area .button { 1876padding: 8px; 1877} 1878 1879.message-dialog { // Message Dialog styling 1880&.background { background-color: $light_color; } 1881.titlebar { 1882border-style: none; 1883// box-shadow: inset 0 1px $highlight_color; 1884background-color: $light_color; 1885} 1886&.csd { // rounded bottom border styling for csd version 1887&.background { 1888// bigger radius for better antialiasing 1889border-bottom-left-radius: 2px; 1890border-bottom-right-radius: 2px; 1891} 1892.dialog-action-area .button { 1893@extend .button.flat; 1894padding: 9px 16px 10px; 1895border-top: 1px solid $borders_color; 1896border-radius: 0; 1897background-size: 192px * 1 / 0.8 192px * 1 / 0.8, auto; 1898// &:first-child{ border-bottom-left-radius: 2px; } 1899// &:last-child { border-bottom-right-radius: 2px; } 1900&:first-child{ border-radius: 0 0 0 2px; } 1901&:last-child { border-radius: 0 0 2px 0; } 1902} 1903} 1904} 1905 1906GtkFileChooserDialog { 1907.search-bar { 1908// background-color: $base_color; 1909// border-color: $bg_color; 1910} 1911.dialog-action-box { 1912border-top: 1px solid $borders_color; 1913} 1914} 1915 1916/*********** 1917* Sidebar * 1918***********/ 1919 1920.sidebar { 1921border: none; 1922background-color: $secondary_base_color; 1923 1924&:selected { 1925@extend %selected_items; 1926} 1927} 1928 1929GtkSidebarRow { 1930// Needs overriding of the GtkListBoxRow padding 1931&.list-row { 1932padding: 0px; 1933} 1934// Using margins/padding directly in the SidebarRow 1935// will make the animation of the new bookmark row jump 1936.sidebar-revealer { 1937padding: 4px 14px 4px 12px; 1938} 1939.sidebar-icon { 1940opacity: 0.75; // dim the device icons 1941&:dir(ltr) { padding-right: 8px; } 1942&:dir(rtl) { padding-left: 8px; } 1943} 1944.sidebar-label { 1945&:dir(ltr) { padding-right: 2px; } 1946&:dir(rtl) { padding-left: 2px; } 1947} 1948} 1949 1950GtkPlacesSidebar.sidebar { 1951// in the sidebar case it makes no sense to click the selected row 1952// .list-row:selected:active { box-shadow: none; } 1953 1954// looks like the label doesn't get all the states so work around 1955.list-row:selected:insensitive .label { @extend %selected_items:insensitive; } 1956// .list-row:selected:backdrop:insensitive .label { @extend %selected_items:backdrop:insensitive; } 1957 1958.sidebar-placeholder-row { 1959border: solid 1px $selected_bg_color; 1960} 1961 1962.sidebar-new-bookmark-row { 1963color: $selected_bg_color; 1964} 1965 1966@at-root .sidebar-button.button { // @at-root needded to not change the specificity making button styling inheritance broken 1967// so istead of "GtkPlacesSidebar.sidebar .sidebar-button.button" [specificity 0,0,3,1] 1968// the extended selector ".sidebar-button.button" [specificity 0,0,2,0] 1969 1970&.image-button { padding: 4px; } 1971 1972@extend .button.flat; 1973// border-radius: 100%; 1974// outline-radius: 100%; 1975} 1976// this is for indicating which sidebar row generated a popover 1977// see https://bugzilla.gnome.org/show_bug.cgi?id=754411 1978.has-open-popup { @extend .list-row.activatable:active; transition: none; } 1979} 1980 1981.sidebar-item { 1982padding: 10px 4px; 1983> .label { 1984padding-left: 6px; 1985padding-right: 6px; 1986} 1987&.needs-attention > .label { 1988@extend %needs_attention; 1989} 1990} 1991 1992/********* 1993* Paned * 1994*********/ 1995 1996GtkPaned { // this is for the standard paned separator 1997 1998-GtkPaned-handle-size: 1; // sets separator width 1999 2000-gtk-icon-source: none; // removes handle decoration 2001margin: 0 8px 8px 0; // drag area of the separator, not a real margin 2002&:dir(rtl) { 2003margin-right: 0; 2004margin-left: 8px; 2005} 2006.pane-separator { 2007background-color: $borders_color; 2008} 2009} 2010 2011GtkPaned.wide { // this is for the paned with wide separator 2012-GtkPaned-handle-size: 6; // wider separator here 2013margin: 0; // no need of the invisible drag area so, reset margin 2014.pane-separator { 2015background-color: transparent; 2016border-style: none solid; 2017border-color: $borders_color; 2018border-width: 1px; 2019} 2020&.vertical .pane-separator { border-style: solid none;} 2021} 2022 2023 2024/************** 2025* GtkInfoBar * 2026**************/ 2027GtkInfoBar { 2028border-style: none; 2029} 2030 2031.info { 2032background-color: $info_bg_color; 2033} 2034 2035.question { 2036background-color: $question_bg_color; 2037} 2038 2039.warning { 2040background-color: $warning_bg_color; 2041} 2042 2043.error { 2044background-color: $error_bg_color; 2045} 2046 2047.info, 2048.question, 2049.warning, 2050.error { 2051color: $selected_fg_color; 2052.button { 2053// @extend .list-row:selected.button; 2054&:insensitive { color: $insensitive_secondary_selected_fg_color; } 2055&.flat { 2056color: $secondary_selected_fg_color; 2057&:hover, &:active { color: $selected_fg_color; } 2058&:insensitive { color: $insensitive_secondary_selected_fg_color; } 2059} 2060} 2061.label:selected, 2062.label:selected:focus, 2063.label:selected:hover { 2064background-color: darken($selected_bg_color, 10%); 2065} 2066} 2067 2068/************ 2069* Tooltips * 2070************/ 2071 2072.tooltip { 2073&.background { 2074// background-color needs to be set this way otherwise it gets drawn twice 2075// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. 2076background-color: gtkopacity($base_color, 0.9); 2077} 2078 2079// @extend %osd; 2080color: $fg_color; 2081padding: 4px; /* not working */ 2082border-radius: 2px; 2083box-shadow: none; // otherwise it gets inherited by windowframe.csd 2084// FIXME: we need a border or tooltips vanish on black background. 2085&.window-frame.csd { 2086background-color: transparent; 2087} 2088} 2089 2090.tooltip * { //Yeah this is ugly 2091padding: 4px; 2092background-color: transparent; 2093color: inherit; // just to be sure 2094} 2095 2096/***************** 2097* Color Chooser * 2098*****************/ 2099 2100GtkColorSwatch { 2101// This widget is made of two boxes one on top of the other, the lower box is GtkColorSwatch {} the other one 2102// is GtkColorSwatch > .overlay {}, GtkColorSwatch has the programmatically set background, so most of the style 2103// is applied to the overlay box. 2104 2105box-shadow: $z-depth-1; 2106 2107// we need to re-set the shadow here since it get axed by the previous bit 2108&:selected { } 2109 2110// base color corners rounding 2111// to avoid the artifacts caused by rounded corner anti-aliasing the base color 2112// sports a bigger radius. 2113// nth-child is needed by the custom color strip. 2114// The :not() madness is needed since actually the overlay is selectable by GtkColorSwatch > .overlay 2115// and GtkColorSwatch.overlay, I know it's weird, but this is gtk+, not a browser. 2116&.top { 2117border-top-left-radius: 2px; 2118border-top-right-radius: 2px; 2119} 2120&.bottom { 2121border-bottom-left-radius: 2px; 2122border-bottom-right-radius: 2px; 2123} 2124&.left, &:first-child:not(.overlay):not(.top) { 2125border-top-left-radius: 2px; 2126border-bottom-left-radius: 2px; 2127} 2128&.right, &:last-child:not(.overlay):not(.bottom) { 2129border-top-right-radius: 2px; 2130border-bottom-right-radius: 2px; 2131} 2132&:only-child:not(.overlay) { border-radius: 2px; } 2133 2134// overlay corner rounding 2135&.top > .overlay { 2136border-top-left-radius: 2px; 2137border-top-right-radius: 2px; 2138} 2139&.bottom > .overlay { 2140border-bottom-left-radius: 2px; 2141border-bottom-right-radius: 2px; 2142} 2143&:first-child:not(.top) > .overlay { 2144border-top-left-radius: 2px; 2145border-bottom-left-radius: 2px; 2146} 2147&:last-child:not(.bottom) > .overlay { 2148border-top-right-radius: 2px; 2149border-bottom-right-radius: 2px; 2150} 2151&:only-child > .overlay { border-radius: 2px; } 2152 2153// hover effect 2154&:hover { box-shadow: $z-depth-2; } 2155 2156// no hover effect for the colorswatch in the color editor 2157GtkColorEditor & { 2158border-radius: 2px; // same radius as the entry 2159&:hover { box-shadow: $z-depth-1; } 2160} 2161 2162// indicator and keynav outline colors 2163&.color-dark { 2164color: white; 2165} 2166&.color-light { 2167color: gtkopacity(black, 0.8); 2168} 2169 2170// border color 2171&.overlay, 2172&.overlay:selected { 2173} 2174 2175// make the add color button looks like, well, a button 2176&#add-color-button { 2177background-image: linear-gradient(to right, 2178$error_bg_color 25%, 2179$warning_bg_color 25%, $warning_bg_color 50%, 2180$info_bg_color 50%, $info_bg_color 75%, 2181$question_bg_color 75%); 2182color: white; 2183} 2184} 2185 2186 2187/******** 2188* Misc * 2189********/ 2190 2191//content view (grid/list) 2192.content-view { 2193background-color: $bg_color; 2194// &:hover { -gtk-image-effect: highlight; } 2195&.rubberband { @extend .rubberband; } 2196} 2197 2198.scale-popup { 2199 2200.osd & { @extend %osd; } 2201 2202.osd & .button.flat { //FIXME: quick hack, redo properly 2203} 2204 2205.button { // +/- buttons on GtkVolumeButton popup 2206padding: 10px; 2207} 2208} 2209 2210GtkScaleButton.button, 2211GtkVolumeButton.button { 2212// I assume both are image-button *by default* 2213// with the image-button/text-button classes automagically applied depending on the button child these selectors can be deleted. 2214@extend %image_button; 2215 2216&.text-button { @extend .text-button } 2217} 2218 2219.floating-bar { 2220@extend %osd; 2221// @extend .toolbar.osd; 2222padding: 3px 0 4px; 2223border: 1px solid $borders_color; 2224background-color: $base_color; 2225transition: none; 2226} 2227 2228.floating-bar.bottom.left { /* axes left border and border radius */ 2229border-width: 1px 1px 0 0; 2230border-radius: 0 2px + 1px 0 0; 2231// border-width: 8px 8px 0 0; 2232// border-image-width: 10px 10px 0 0; 2233} 2234 2235.floating-bar.bottom.right { /* axes right border and border radius */ 2236border-width: 1px 0 0 1px; 2237border-radius: 2px + 1px 0 0 0; 2238// border-width: 8px 0 0 8px; 2239// border-image-width: 10px 0 0 10px; 2240} 2241 2242/********************** 2243* Window Decorations * 2244*********************/ 2245 2246.window-frame { 2247transition: none; 2248border-radius: 2px 2px 0 0; 2249box-shadow: $z-depth-4; 2250 2251// FIXME rationalize window-frame shadows 2252 2253/* this is used for the resize cursor area */ 2254margin: 8px; 2255 2256&:backdrop { 2257box-shadow: $z-depth-2; 2258} 2259&.tiled { 2260border-radius: 0; 2261} 2262&.popup { 2263box-shadow: none; 2264} 2265// server-side decorations as used by mutter 2266&.ssd { 2267box-shadow: 0 0 0 1px $borders_color; //just doing borders, wm draws actual shadows 2268} 2269&.csd { 2270&.popup { 2271border-radius: 0; 2272box-shadow: $z-depth-2; 2273} 2274&.tooltip { 2275border-radius: 2px; 2276box-shadow: $z-depth-2; 2277} 2278&.message-dialog { 2279border-radius: 2px; 2280box-shadow: $z-depth-4; 2281&:backdrop { box-shadow: $z-depth-2; } 2282} 2283} 2284&.solid-csd { 2285border-radius: 0; 2286margin: 4px; 2287background-color: $warning_color; 2288border: solid 1px $borders_color; 2289box-shadow: none; 2290} 2291} 2292 2293// Window Close button 2294.header-bar .button.titlebutton, 2295.titlebar .button.titlebutton { 2296// @extend .button.flat; 2297@extend %image_button; 2298} 2299 2300.header-bar.selection-mode .button.titlebutton, 2301.titlebar.selection-mode .button.titlebutton { 2302// &:backdrop { icon-shadow: none; } 2303} 2304 2305 2306// catch all extend :) 2307 2308%selected_items { 2309background-color: $selected_bg_color; 2310color: $selected_fg_color; 2311&:insensitive { color: $insensitive_selected_fg_color; } 2312&:backdrop { 2313// color: $backdrop_selected_fg_color; 2314&:insensitive { 2315color: $insensitive_selected_fg_color; 2316} 2317} 2318} 2319 2320.monospace { 2321font: Monospace; 2322} 2323 2324/********************** 2325* Touch Copy & Paste * 2326*********************/ 2327 2328//touch selection handlebars for the Popover.osd above 2329.entry.cursor-handle, 2330.cursor-handle { 2331background-color: $success_color; 2332background-image: none; 2333box-shadow: none; 2334border-style: none; 2335@each $s,$as in ('',''), 2336(':hover','-hover'), 2337(':active','-active') { //no need for insensitive and backdrop 2338&.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) { 2339$_url: 'assets/text-select-start#{$as}#{$asset_suffix}'; 2340-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2341url('#{$_url}@2.png')); 2342padding-left: 10px; 2343} 2344&.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) { 2345$_url: 'assets/text-select-end#{$as}#{$asset_suffix}'; 2346-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2347url('#{$_url}@2.png')); 2348padding-right: 10px; 2349} 2350&.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) { 2351$_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}'; 2352-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2353url('#{$_url}@2.png')); 2354} 2355} 2356} 2357 2358/* Decouple the font of context menus from their entry/textview */ 2359.context-menu { 2360font: initial; 2361} 2362 2363.touch-selection { 2364font: initial; 2365color: $fg_color; 2366background-color: $base_color; 2367box-shadow: $z-depth-2; 2368&:backdrop { box-shadow: $z-depth-1; } 2369.button { 2370} 2371} 2372 2373// This is used by GtkScrolledWindow, when content is touch-dragged past boundaries. 2374// This draws a box on top of the content, the size changes programmatically. 2375.overshoot { 2376&.top { 2377@include overshoot(top); 2378} 2379&.bottom { 2380@include overshoot(bottom); 2381} 2382&.left { 2383@include overshoot(left); 2384} 2385&.right { 2386@include overshoot(right); 2387} 2388} 2389 2390// Overflow indication, works similarly to the overshoot, the size if fixed tho. 2391.undershoot { 2392&.top { 2393@include undershoot(top); 2394} 2395 2396&.bottom { 2397@include undershoot(bottom); 2398} 2399 2400&.left { 2401@include undershoot(left); 2402} 2403 2404&.right { 2405@include undershoot(right); 2406} 2407} 2408