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