_common.scss 84.6 KB
Newer Older
1 2 3 4
@function gtkalpha($c,$a) {
  @return unquote("alpha(#{$c},#{$a})");
}

5 6
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* {
  padding: 0;
  -GtkToolButton-icon-spacing: 4;
  -GtkTextView-error-underline-color: $error_color;
  -gtk-icon-style: symbolic; //force symbolic style icons

  // The size for scrollbars. The slider is 2px smaller, but we keep it
  // up so that the whole area is sensitive to button presses for the
  // slider. The stepper button is larger in both directions, the slider
  // only in the width

  -GtkScrolledWindow-scrollbar-spacing: 0;

  -GtkToolItemGroup-expander-size: 11;

  -GtkTreeView-horizontal-separator: 4;

  -GtkDialog-button-spacing: 4;
  -GtkDialog-action-area-border: 0;

  // We use the outline properties to signal the focus properties
  // to the adwaita engine: using real CSS properties is faster,
  // and we don't use any outlines for now.

31
  outline-color: currentColor;
32
  outline-style: dashed;
33 34
  outline-offset: -4px;
  outline-width: 2px;
35
  -gtk-outline-radius: 2px;
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

}


/***************
 * Base States *
 ***************/

.background {
    color: $fg_color;
    background-color: $bg_color;
}

.background:backdrop {
    text-shadow: none;
51
    -gtk-icon-shadow: none;
52 53 54 55 56 57 58 59 60 61 62 63 64 65

    color: lighten($fg_color,10%);
    background-color: $backdrop_bg_color;
}

/*
   These wildcard seems unavoidable, need to investigate.
   Wildcards are bad and troublesome, use them with care,
   or better, just don't.
   Everytime a wildcard is used a kitten dies, painfully.
*/



66
*:disabled {
67
    -gtk-icon-effect: dim;
68 69 70 71 72
}

.gtkstyle-fallback {
  background-color: $bg_color;
  color: $fg_color;
73
  &:hover {
74 75 76 77 78 79 80
    background-color: lighten($bg_color, 10%);
    color: $fg_color;
  }
  &:active {
    background-color: darken($bg_color, 10%);
    color: $fg_color;
  }
81
  &:disabled {
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
    background-color: $insensitive_bg_color;
    color: $insensitive_fg_color;
  }
  &:selected {
    background-color: $selected_bg_color;
    color: $selected_fg_color;
  }
}

.view {
  color: $fg_color;
  background-color: $base_color;
  &:backdrop {
    color: $backdrop_fg_color;
    background-color: $backdrop_base_color;
  }
98 99 100 101
  &:disabled {
    color: $insensitive_fg_color;
    background-color: $insensitive_bg_color;
  }
102 103 104
  &:selected,
  &:selected:focus,
  &:selected:hover { @extend %selected_items; }
105 106
}

107 108 109 110 111 112
textview text {
  @extend .view;

  selection,
  selection:focus,
  selection:hover {
113 114 115 116
    @extend %selected_items;
  }
}

117 118
iconview { @extend .view ;}

119 120
.rubberband,
rubberband {
121 122 123 124
  border: 1px solid $selected_bg_color;
  background-color: transparentize($selected_bg_color,0.8);
}

125 126
flowbox {
  & rubberband { @extend rubberband; }
127 128 129 130 131 132 133 134
  flowboxchild {
    padding: 3px;
    border-radius: 3px;
    &:selected {
      @extend %selected_items;
      outline-offset: -2px;
    }
  }
135 136
}

137
label {
138 139 140 141
  & selection,
  & selection:focus,
  & selection:hover,
  & selection:backdrop {
142 143
    @extend %selected_items;
  }
144
  &:disabled, &:backdrop:disabled {
145 146
    color: $insensitive_fg_color;
  }
147 148
}

149 150 151 152 153
%osd, .osd {
  color: $osd_fg_color;
  border: none;
  background-color: $osd_bg_color;
  background-clip: padding-box;
154 155
  //text-shadow: 0 1px black;
  //-gtk-icon-shadow: 0 1px black;
156 157 158 159 160 161 162

  &:backdrop {
    text-shadow: none;
    -gtk-icon-shadow: none;
  }
}

163 164 165 166 167 168 169 170
/*********************
 * Spinner Animation *
 *********************/

@keyframes spin {
    to { -gtk-icon-transform: rotate(1turn); }
}

171
spinner {
172 173 174
  background-image: none;
  opacity: 0; // non spinning spinner makes no sense
  -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
175
  &:checked {
176 177
    opacity: 1;
    animation: spin 1s linear infinite;
178
    &:disabled {
179 180 181 182 183 184 185 186 187
      opacity: 0.5;
    }
  }
}

/****************
 * Text Entries *
 ****************/

188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
%entry,
entry {
  %entry_basic, & {
    min-height: 32px;
    padding-left: 8px;
    padding-right: 8px;
    border: 1px solid;
    border-radius: 3px;
    transition: all 200ms $ease-out-quad;

    @include entry(normal);

    image { // icons inside the entry
      &.left { padding-left: 0; padding-right: 6px; }
      &.right { padding-left: 6px; padding-right: 0; }
    }

    undershoot {
      &.left { @include undershoot(left); }
      &.right { @include undershoot(right); }
    }

    &.flat {
211
      &:focus, &:backdrop, &:disabled, & {
212 213 214 215 216
        min-height: 0;
        padding: 2px;
        background-image: none;
        border-color: transparent;
        border-radius: 0;
217
        box-shadow: none;
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
      }
    }

    &:focus { @include entry(focus); }

    &:disabled { @include entry(insensitive); }

    &:backdrop { @include entry(backdrop); }

    &:backdrop:disabled { @include entry(backdrop-insensitive); }

    selection { &:focus, & { @extend %selected_items; }}

    // entry error and warning style
    @each $e_type, $e_color in (error, $error_color),
                               (warning, $warning_color) {
      &.#{$e_type} {
        color: $e_color;
        border-color: entry_focus_border($e_color);

        &:focus { @include entry(focus, $e_color); }

        &:selected { &:focus, & { background-color: $e_color; }}
      }
    }

    & image { // entry icons colors
      color: mix($fg_color, $base_color, 80%);

      &:hover { color: $fg_color; }

      &:active { color: $selected_bg_color; }

      &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 80%); }
    }

    &:drop(active) {
      &:focus, & {
        border-color: $fg_color;
        box-shadow: inset 0 0 0 1px $fg_color;
      }
    }

    .osd & {
      @include entry(osd);

      &:focus { @include entry(osd-focus); }

      &:backdrop { @include entry(osd-backdrop); }

      &:disabled { @include entry(osd-insensitive); }
    }
270
  }
271 272 273 274 275

  progress {
    margin: 2px -6px;
    background-color: transparent;
    background-image: none;
276 277 278 279 280
    border-radius: 0;
    border-width: 0 0 2px;
    border-color: $selected_bg_color;
    border-style: solid;
    box-shadow: none;
281

282 283
    &:backdrop { background-color: transparent; }
  }
284 285 286 287 288 289 290 291 292 293 294 295 296 297

   // linked entries
  .linked:not(.vertical) > & { @extend %linked; }
  .linked:not(.vertical) > &:focus + &,
  .linked:not(.vertical) > &:focus + button,
  .linked:not(.vertical) > &:focus + combobox > box > button.combo { border-left-color: entry_focus_border(); }

  .linked:not(.vertical) > &:drop(active) + &,
  .linked:not(.vertical) > &:drop(active) + button,
  .linked:not(.vertical) > &:drop(active) + combobox > box > button.combo { border-left-color: $fg_color; }

  // Vertically linked entries
  // FIXME: take care of "colored" entries
  .linked.vertical > & {
298
    @extend %linked_vertical;
299 300 301 302 303

    // brighter border between linked entries
    &:not(:disabled) + entry:not(:disabled),
    &:not(:disabled) + %entry:not(:disabled) {
      border-top-color: mix($borders_color, $base_color, 30%);
304
      background-image: _solid($base_color);
305

306
      &:backdrop {
307
        border-top-color: mix($backdrop_borders_color, $backdrop_base_color, 30%);
308
        background-image: _solid($backdrop_base_color);
309 310
      }
    }
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330

    // brighter border between linked insensitive entries
    &:disabled + %entry:disabled,
    &:disabled + entry:disabled { border-top-color: mix($borders_color, $base_color, 30%); }

    // color back the top border of a linked focused entry following another entry and add back the focus shadow.
    // :not(:only-child) is a specificity bump hack.
    + %entry:focus:not(:only-child),
    + entry:focus:not(:only-child) { border-top-color: entry_focus_border(); }

    + %entry:drop(active):not(:only-child),
    + entry:drop(active):not(:only-child) { border-top-color: $fg_color; }

    // this takes care of coloring the top border of the focused entry subsequent widget.
    // :not(:only-child) is a specificity bump hack.
    &:focus:not(:only-child) {
      + %entry,
      + entry,
      + button,
      + combobox > box > button.combo { border-top-color: entry_focus_border(); }
331
    }
332 333 334 335 336 337

    &:drop(active):not(:only-child) {
      + %entry,
      + entry,
      + button,
      + combobox > box > button.combo { border-top-color: $fg_color; }
338 339 340 341 342 343 344
    }
  }
}

/***********
 * Buttons *
 ***********/
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
// stuff for .needs-attention
$_dot_color: $selected_bg_color;

@keyframes needs_attention {
  from {
    background-image: -gtk-gradient(radial,
                                    center center, 0,
                                    center center, 0.01,
                                    to($_dot_color),
                                    to(transparent));
  }
  to {
    background-image: -gtk-gradient(radial,
                                    center center, 0,
                                    center center, 0.5,
                                    to($selected_bg_color),
                                    to(transparent));
  }
}
364

365

366
button {
367 368
  @at-root %button_basic, & {
    $_button_transition: all 200ms $ease-out-quad;
369

370 371 372 373 374 375 376 377 378
    min-height: 24px;
    min-width: 16px;
    padding: 4px 8px;
    border: 1px solid;
    border-radius: 3px;
    transition: $_button_transition;

    @include button(normal);

379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
    &:disabled {
      @include button(insensitive);

      &:active,
      &:checked { @include button(insensitive-active); }
    }

    &:backdrop {
      @include button(backdrop);

      -gtk-icon-effect: none;

      &:active,
      &:checked { @include button(backdrop-active); }

      &:disabled {
        @include button(backdrop-insensitive);

        &:active,
        &:checked { @include button(backdrop-insensitive-active); }
      }
    }

402 403
    &.flat {
      @include button(undecorated);
404

405 406 407 408 409 410 411 412 413 414 415 416
      // to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set
      // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but
      // it won't fade out when the pointer leave the button allocation area. To make the transition more evident
      // in this case the duration is increased.
      transition: none;

      &:hover {
        transition: $_button_transition;
        transition-duration: 500ms;

        &:active { transition: $_button_transition; }
      }
417 418 419

      &:backdrop,
      &:disabled,
420 421 422
      &:backdrop:disabled {
        @include button(undecorated-insensitive);
      }
423
    }
424

425 426
    &:hover,
    &.flat:hover {
427 428
      @include button(hover);
      -gtk-icon-effect: highlight;
429
    }
430 431 432 433 434 435

    &:active,
    &:checked {
      @include button(active);

      transition-duration: 50ms;
436
    }
437 438 439 440 441 442 443 444 445 446 447 448 449

    &.image-button {
      min-width: 24px;
      padding-left: 4px;
      padding-right: 4px;
    }

    &.text-button {
      padding-left: 16px;
      padding-right: 16px;
    }

    &.text-button.image-button {
450 451
      padding-left: 8px;
      padding-right: 8px;
452 453 454 455 456 457 458 459 460 461 462

      label {
        padding-left: 8px;
        padding-right: 8px;
      }
    }

    &:drop(active) {
      color: $fg_color;
      border-color: $fg_color;
      box-shadow: inset 0 0 0 1px $fg_color;
463 464
    }
  }
465

466 467 468 469 470 471 472 473 474
  @at-root %button_selected, & {
    row:selected & {
      @if $variant == 'light' { border-color: $selected_borders_color; }

      &.flat:not(:active):not(:checked):not(:hover):not(disabled) {
        color: $selected_fg_color;
        border-color: transparent;

        &:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
475
      }
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
    }
  }


  // big standalone buttons like in Documents pager
  &.osd {
    &.image-button {
      min-height: 48px;
      min-width: 48px;
    }

    color: $osd_fg_color;
    border-radius: 5px;

    @include button(osd);

    border: none;
    box-shadow: none;

    &:hover {
      @include button(osd-hover);

      border: none;
      box-shadow: none;
    }

    &:active,
    &:checked {
      @include button(osd-active);

      border: none;
      box-shadow: none;
    }

    &:disabled {
      &:backdrop, & {
        @include button(osd-insensitive);

        border: none;
515 516
      }
    }
517 518 519 520 521 522

    &:backdrop {
      @include button(osd-backdrop);

      border: none;
    }
523 524
  }

525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
  //overlay / OSD style
  @at-root %osd_button,
  .osd & {
    @include button(osd);

    &:hover { @include button(osd-hover); }

    &:active,
    &:checked { &:backdrop, & { @include button(osd-active); }}

    &:disabled { &:backdrop, & { @include button(osd-insensitive); }}

    &:backdrop { @include button(osd-backdrop); }

    &.flat {
      @include button(undecorated);

      box-shadow: none; //FIXME respect no edge on the button mixin
      text-shadow: 0 1px black;
      -gtk-icon-shadow: 0 1px black;

      &:hover { @include button(osd-hover); }

      &:disabled {
        @include button(osd-insensitive);
        background-image: none;
        border-color: transparent;
        box-shadow: none;
      }

      &:backdrop { @include button(undecorated); }

      &:active,
      &:checked { @include button(osd-active); }
    }
  }

562
  // Suggested and Destructive Action buttons
563 564
  @each $b_type, $b_color, $f_color in (suggested-action, $selected_bg_color, $selected_fg_color),
                             (destructive-action, $destructive_color, white) {
565
    &.#{$b_type} {
566
      @include button(normal, $b_color, $f_color);
567 568 569 570 571 572 573

      &.flat {
        @include button(undecorated);

        color: $b_color; //FIXME: does it work on the dark variant?
      }

574
      &:hover { @include button(hover, $b_color, $f_color); }
575 576

      &:active,
577
      &:checked { @include button(active, $b_color, $f_color); }
578 579 580

      &:backdrop,
      &.flat:backdrop {
581
        @include button(backdrop, $b_color, $f_color);
582 583

        &:active,
584
        &:checked { @include button(backdrop-active, $b_color, $f_color); }
585 586 587 588 589

        &:disabled {
          @include button(backdrop-insensitive);

          &:active,
590
          &:checked { @include button(backdrop-insensitive-active, $b_color, $f_color); }
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605
        }
      }

      &.flat {
        &:backdrop, &:disabled, &:backdrop:disabled {
          @include button(undecorated);

          color: transparentize($b_color, 0.2);
        }
      }

      &:disabled {
        @include button(insensitive);

        &:active,
606
        &:checked { @include button(insensitive-active, $b_color, $f_color); }
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669
      }

      .osd & {
        @include button(osd, $b_color);

        &:hover { @include button(osd-hover, $b_color); }

        &:active,
        &:checked { &:backdrop, & { @include button(osd-active, $b_color); }}

        &:disabled { &:backdrop, & { @include button(osd-insensitive, $b_color); }}

        &:backdrop { @include button(osd-backdrop, $b_color); }
      }
    }
  }

  .stack-switcher > & {
    // to position the needs attention dot, padding is added to the button
    // child, a label needs just lateral padding while an icon needs vertical
    // padding added too.

    outline-offset: -3px; // needs to be set or it gets overriden by GtkRadioButton outline-offset

    > label {
      padding-left: 6px;  // label padding
      padding-right: 6px; //
    }

    > image {
      padding-left: 6px;   // image padding
      padding-right: 6px;  //
      padding-top: 3px;    //
      padding-bottom: 3px; //
    }

    &.text-button {
      // compensate text-button paddings
      padding-left: 10px;
      padding-right: 10px;
    }

    &.image-button {
      // we want image buttons to have a 1:1 aspect ratio, so compensation
      // of the padding added to the GtkImage is needed
      padding-left: 2px;
      padding-right: 2px;
    }

    &.needs-attention {
      > label,
      > image { @extend %needs_attention; }

      &:active,
      &:checked {
        > label,
        > image {
          animation: none;
          background-image: none;
        }
      }
    }
  }
670 671 672 673 674 675 676 677

  //inline-toolbar buttons
  .inline-toolbar &, .inline-toolbar &:backdrop {
    border-radius: 2px;
    border-width: 1px;
    @extend %linked;
  }

678
  .primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
679

680 681 682 683 684 685 686 687 688 689 690
  .linked > &,
  .linked > &:hover,
  .linked > &:active,
  .linked > &:checked,
  .linked > &:backdrop { @extend %linked; }

  .linked.vertical > &,
  .linked.vertical > &:hover,
  .linked.vertical > &:active,
  .linked.vertical > &:checked,
  .linked.vertical > &:backdrop { @extend %linked_vertical; }
691 692
}

693 694 695 696 697 698 699
%needs_attention {
  animation: needs_attention 150ms ease-in;
  background-image: -gtk-gradient(radial,
                                  center center, 0,
                                  center center, 0.5,
                                  to($_dot_color),
                                  to(transparent));
700
  background-size: 6px 6px;
701
  background-repeat: no-repeat;
702

703
  background-position: right 3px;
704

705
  &:backdrop { background-size: 6px 6px;}
706

707
  &:dir(rtl) { background-position: left 3px; }
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740
}


// all the following is for the +|- buttons on inline toolbars, that way
// should really be deprecated...
.inline-toolbar toolbutton > button { // redefining the button look is
                                      // needed since those are flat...
  @include button(normal);

  &:hover { @include button(hover); }

  &:active,
  &:checked{ @include button(active); }

  &:disabled {
    @include button(insensitive);

    &:active,
    &:checked { @include button(insensitive-active); }
  }

  &:backdrop {
    @include button(backdrop);

    &:active,
    &:checked { @include button(backdrop-active); }

    &:disabled {
      @include button(backdrop-insensitive);

      &:active,
      &:checked { @include button(backdrop-insensitive-active); }
    }
741 742 743
  }
}

744 745 746 747 748 749 750 751 752 753 754 755
// More inline toolbar buttons
toolbar.inline-toolbar toolbutton,
toolbar.inline-toolbar toolbutton:backdrop {
  & > button.flat { @extend %linked_middle; }

  &:first-child > button.flat { @extend %linked:first-child; }

  &:last-child > button.flat { @extend %linked:last-child; }

  &:only-child > button.flat { @extend %linked:only-child; }
}

756 757
%linked_middle {
  border-radius: 0;
758
  border-right-style: none;
759 760 761 762
}

%linked {
  @extend %linked_middle;
763

764
  &:first-child {
765 766
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
767
  }
768

769
  &:last-child {
770 771 772
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    border-right-style: solid;
773
  }
774

775 776 777 778 779 780
  &:only-child {
    border-radius: 3px;
    border-style: solid;
  }
}

781
%linked_vertical_middle {
782
  border-style: solid solid none solid;
783 784 785
  border-radius: 0;
}

786
%linked_vertical{
787
  @extend %linked_vertical_middle;
788

789
  &:first-child {
790 791
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
792
  }
793

794
  &:last-child {
795 796 797
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    border-style: solid;
798
  }
799

800 801 802 803 804 805 806 807 808
  &:only-child {
    border-radius: 3px;
    border-style: solid;
  }
}

%undecorated_button {
  background-color: transparent;
  background-image: none;
809 810 811
  border-color: transparent;
  box-shadow: inset 0 1px transparentize(white,1),
              0 1px transparentize(white, 1);
812
  text-shadow: none;
813
  -gtk-icon-shadow: none;
814 815 816
}

/* menu buttons */
817
modelbutton.flat,
818
.menuitem.button.flat {
819 820 821 822 823 824
  min-height: 26px;
  padding-left: 5px;
  padding-right: 5px;
  border-radius: 3px;
  outline-offset: -2px;

825
  @extend %undecorated_button;
826 827 828 829 830 831 832 833 834 835 836 837 838 839

  &:hover { background-color: $popover_hover_color; }

  &:selected { @extend %selected_items; }

  &:backdrop,
  &:backdrop:hover { @extend %undecorated_button; }

  // FIXME: remove the following when the checks/radios rewrite lands
  check:last-child,
  radio:last-child { margin-left: 8px; }

  check:first-child,
  radio:first-child { margin-right: 8px; }
840 841
}

842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863
modelbutton.flat arrow {
  background: none;

  &:hover { background: none; }

  &.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }

  &.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
}

button.color {
  padding: 4px;

  colorswatch:only-child {
    &, overlay { border-radius: 0; }

    @if $variant == 'light' {
      &:disabled,
      &:backdrop { box-shadow: none; }
    }
  }
}
864

865

866 867 868 869 870 871 872 873 874 875 876 877 878 879
/*********
 * Links *
 *********/

*:link {
  color: $selected_bg_color; //FIXME use a proper color
  &:hover, &:active, &:visited {
    color: mix($fg_color, $selected_bg_color, 40%); //FIXME same here
  }
  &:backdrop, &:backdrop:hover {
    color: $selected_bg_color;
  }
}

880
button:link, button:visited {
881 882
  color: $suggested_color;
  font-weight: bold;
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
  @extend %undecorated_button;
  text-shadow: none;
  &:hover, &:active {
    @extend %undecorated_button;
    color: mix($fg_color, $selected_bg_color, 40%); //FIXME same here
    text-shadow: none;
  }
  &:backdrop {
    @extend %undecorated_button; //This shouldn't be needed but avoids
                                 //a weird transition which for some reason
                                 //makes borders blink on hover
    color: $selected_bg_color; //FIXME use a proper color
  }
}

/*****************
 * GtkSpinButton *
 *****************/
901
spinbutton {
902 903 904 905 906 907 908 909
   
  &:not(.vertical) {
    // in this horizontal configuration, the whole spinbutton
    // behaves as the entry, so we extend the entry styling
    // and nuke the style on the internal entry
    @extend %entry;
    border-width: 2px;
    border-color: $borders_color;
910
    box-shadow: none;
911
    padding: 0;
912 913
    
 
914 915 916 917 918
    entry {
      min-width: 28px;
      margin: 0;
      background: none;
      border: none;
919
      box-shadow: none;
920
    }
921 922 923 924 925 926 927 928 929 930 931

    button {
      min-height: 16px;
      margin: 0;
      padding-bottom: 0;
      padding-top: 0;
      color: mix($fg_color, $base_color, 90%);
      background-image: none;
      border-style: none none none solid;
      border-radius: 0;

932
      &:dir(rtl) { border-style: none solid none none; }
933 934 935 936 937 938 939 940 941

      &:hover {
        color: $fg_color;
        background-color: $bg_color;
      }

      &:disabled { color: transparentize($insensitive_fg_color, 0.7); }

      &:active {
942 943
        background-color: $osd_bg_color;
        color: $osd_fg_color;
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
      }

      &:backdrop {
        color: $backdrop_fg_color;
        background-color: transparent;
        border-color: transparentize($backdrop_borders_color, 0.7);
      }

      &:backdrop:disabled {
        color: $insensitive_bg_color;
        background-image: none;
        border-style: none none none solid; // It is needed or it gets overridden

        &:dir(rtl) { border-style: none solid none none; }
      }
959 960
    }
  }
961 962 963

  // OSD horizontal
  .osd &:not(.vertical) {
964 965
    border-color: $osd_borders_color;
    color: $fg_color;
966
    box-shadow: none;
967 968 969 970 971 972 973
    
    &:focus, &:active {
      border-color: opacify($osd_borders_color,0.5);
      box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
    }
    
    entry {
974
      box-shadow: none;
975 976
      color: $fg_color;
      text-shadow: none;
977 978 979
      &:focus, &:active {
        box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
      }
980 981
    }
    
982
    button {
983 984
      @include button(undecorated);

985
      color: $fg_color;
986
      border-style: none none none solid;
987
      border-color: transparentize($borders_color,0.8);
988 989 990 991 992
      border-radius: 0;
      box-shadow: none;

      &:dir(rtl) { border-style: none solid none none; }

993 994 995 996
      &:active {
        background-color: $osd_bg_color;
        color: $osd_fg_color;
      }
997 998
      &:hover {
        @include button(undecorated);
999 1000 1001
        
        border-style: none none none solid;
        border-color: transparentize($borders_color,0.8);
1002 1003
        background-color: transparentize($osd_fg_color, 0.9);
        box-shadow: none;
1004
      }
1005 1006 1007 1008

      &:backdrop {
        @include button(undecorated);

1009
        color: $insensitive_fg_color;
1010
        border-color: transparentize($borders_color,0.9);
1011
        box-shadow: none;
1012
        border-style: none none none solid;
1013
      }
1014 1015

      &:disabled {
1016
        //@include button(undecorated);
1017 1018

        color: $insensitive_fg_color;
1019
        border-color: transparentize($borders_color,0.9);
1020
        border-style: none none none solid;
1021
        box-shadow: none;
1022
      }
1023 1024 1025 1026

      &:last-child { border-radius: 0 3px 3px 0; }

      &:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
1027
    }
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052
  }

  // Vertical
  &.vertical {
    // in the vertical configuration, we treat the spinbutton
    // as a box, and tweak the style of the entry in the middle
    // so that it's linked

    // FIXME: this should not be set at all, but otherwise it gets the wrong
    // color
    border-width: 2px;
    border-color: $borders_color;
  
    &:disabled { color: $insensitive_fg_color; }
    &:backdrop:disabled { color: $insensitive_fg_color; }

    &:drop(active) {
      border-color: transparent;
      box-shadow: none;
    }

    entry {
      min-height: 32px;
      min-width: 32px;
      padding: 0;
1053
      border-radius: 0;
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064
      border-color: $borders_color;
    }

    button {
      min-height: 32px;
      min-width: 32px;
      padding: 0;

      &.up { @extend %top_button; }

      &.down { @extend %bottom_button; }
1065
    }
1066

1067 1068
    %top_button {
      border-radius: 3px 3px 0 0;
1069
      border-style: solid solid none solid;
1070
    }
1071

1072 1073
    %bottom_button {
      border-radius: 0 0 3px 3px;
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
      border-style: none solid solid solid;
    }
  }

  // OSD vertical
  .osd &.vertical button:first-child {
    @include button(osd);

    &:hover { @include button(osd-hover);}

    &:active { @include button(osd-active); }

    &:disabled { @include button(osd-insensitive); }

    &:backdrop { @include button(osd-backdrop); }
  }

  // Misc
  treeview & {
    entry,
    entry:focus {
      padding: 1px;
      border-width: 1px 0;
      border-color: $selected_bg_color;
      border-radius: 0;
      box-shadow: none;
1100 1101 1102 1103 1104 1105 1106
    }
  }
}

/**************
 * ComboBoxes *
 **************/
1107
combobox {
1108
  arrow {
1109 1110 1111 1112
    -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
    min-height: 16px;
    min-width: 16px;
  }
1113 1114 1115 1116 1117

  &.linked {
    button:nth-child(2) {
      &:dir(ltr) { @extend %linked:last-child; }
      &:dir(rtl) { @extend %linked:first-child; }
1118 1119
    }
  }
1120 1121 1122 1123 1124

  &:drop(active) { // FIXME: untested
    box-shadow: none;

    button.combo { @extend %button_basic:drop(active); }
1125 1126 1127
  }
}

1128 1129 1130 1131 1132 1133 1134
.linked > combobox > box > button.combo {
  // the combo is a composite widget so the way we do button linking doesn't
  // work, special case needed. See
  // https://bugzilla.gnome.org/show_bug.cgi?id=733979

  &:dir(ltr),
  &:dir(rtl) { @extend %linked_middle; } // specificity bump
1135
}
1136

1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }

.linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }


1147 1148 1149
/************
 * Toolbars *
 ************/
1150
toolbar { //FIXME: why is all this being ignored?
1151 1152 1153 1154 1155 1156
  padding: 6px;
  background-color: $bg_color;
  &.osd {
    background-color: $osd_bg_color;
    border-radius: 6px;
    padding: 12px;
1157
    & label { color: $osd_fg_color; }
1158 1159 1160 1161 1162 1163 1164 1165
  }
  //searchbar & inline-toolbar
  &.inline-toolbar {
    @extend %inset-bar;
    border-width: 0 1px 1px;
    padding: 3px;
    border-radius: 0  0 4px 4px;
  }
1166 1167 1168 1169 1170 1171 1172
  &.vertical {
    border-right: 1px solid $borders_color;
    &:dir(rtl) {
      border-right: none;
      border-left: 1px solid $borders_color;
    }
  }
1173 1174
}

1175
searchbar > revealer > box {
1176
  @extend toolbar;
1177
  border-width: 0 0 1px;
1178 1179
  border-color: $borders_color;
  border-style: none none solid none;
1180

1181
  // workaround: undo the GtkContainer:border-width and use CSS padding instead
1182 1183
  margin: -6px;
  padding: 9px;
1184 1185
}

1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203
%inset-bar {
  border-style: solid;
  border-color: $borders_color;
  $_bg: mix($bg_color, $borders_color, 70%);
  background-color: $_bg;
  box-shadow: inset 0 2px 3px -1px mix($borders_color, $_bg, 60%);
  //FIXME edge would be nice, but doesn't work
  &:backdrop {
    border-color: $backdrop_borders_color;
    background-color: mix($backdrop_borders_color,$backdrop_bg_color, 35%);
    box-shadow: none;
  }
}

/***************
 * Header bars *
 ***************/

1204
%titlebar,
1205
headerbar {
1206
  min-height: 46px;
1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227
  border-width: 0 0 1px;
  border-style: solid;
  border-color: $borders_color;
  border-radius: 7px 7px 0 0;

  background-color: transparent;
  background-image: linear-gradient(to bottom,
                                    lighten($bg_color,4%),
                                    $bg_color);
  box-shadow: inset 0 -1px mix($borders_color, $bg_color, 30%), // bottom shade
              inset 0 1px $borders_edge; // top highlight
  padding: 6px;

  &:backdrop {
    border-color: $backdrop_borders_color;
    background-color: $bg_color;
    background-image: none;
    box-shadow: none;
  }

  .title {
1228
    font-weight: bold;
1229 1230 1231 1232 1233 1234
    padding: 0px 12px;
  }
  .subtitle {
    font-size: 80%;
    padding: 0 12px;
  }
1235

1236 1237 1238 1239 1240 1241 1242 1243
  &.selection-mode {
    color: darken($selected_bg_color, 15%);
    text-shadow: 0 1px transparentize(black, 0.5);
    background-image: linear-gradient(to bottom,
                                    lighten($selected_bg_color,5%),
                                    lighten($selected_bg_color,2%));
    box-shadow: inset 0 -1px mix($borders_color,$bg_color, 30%), //bottom shade
                inset 0 1px mix($borders_edge,$selected_bg_color, 50%); //top highlight
1244
    button {
1245 1246 1247
      @include button(normal, $selected_bg_color, $selected_fg_color, $edge: none);
      &:hover { @include button(hover, $selected_bg_color, $selected_fg_color, $edge: none); }
      &:active { @include button(active, $selected_bg_color, $selected_fg_color, $edge: none); }
1248
      &:disabled { @include button(insensitive, $selected_bg_color, $selected_fg_color, $edge: none); }
1249
      &:backdrop {
1250
        @include button(backdrop, $selected_bg_color, $selected_fg_color, $edge: none);
1251 1252
        border-color: darken($selected_bg_color, 15%);
      }
1253
      &:backdrop:disabled { @include button(backdrop-insensitive, $selected_bg_color, $selected_fg_color, $edge: none); }
1254
      &.suggested-action {
1255 1256 1257
        @include button($t:normal, $edge: none);
        &:hover { @include button($t:hover,$edge: none); }
        &:active { @include button($t:active, $edge: none); }
1258
        &:disabled { @include button($t:insensitive, $edge: none); }
1259
        &:backdrop { @include button($t:backdrop, $edge: none); }
1260
        &:backdrop:disabled { @include button($t:backdrop-insensitive, $edge: none); }
1261 1262 1263 1264 1265 1266 1267 1268
      }
    }
    .selection-menu {
      border-width: 0;
      background-image: none;
      box-shadow: none;
    }
  }
1269 1270 1271 1272 1273 1274

  // squared corners when the window is maximized, tiled, or fullscreen
  .tiled &,
  .maximized &,
  .fullscreen & {
    border-radius: 0;
1275
  }
1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287

  &.default-decoration {
    min-height: 28px;
    padding: 4px;

    button.titlebutton {
      min-height: 26px;
      min-width: 26px;
      margin: 0;
      padding: 0;
    }
  }
1288 1289
}

1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
.titlebar:not(headerbar) {
  window.csd > & {
    // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
    padding: 0;
    background-color: transparent;
    background-image: none;
    border-style: none;
    border-color: transparent;
    box-shadow: none;
  }

  @extend %titlebar;
}


1305 1306 1307 1308
/************
 * Pathbars *
 ************/

1309
.path-bar button {
1310 1311 1312 1313 1314 1315 1316 1317 1318
  padding: 5px 6px 6px;
  &:first-child { padding-left: 8px; }
  &:last-child { padding-right: 8px; }
  &:only-child {
    padding-left: 12px;
    padding-right: 12px;
  }

  // the following is for spacing the icon and the label inside the home button
1319 1320 1321
  & label:last-child { padding-left: 2px; }
  & label:first-child { padding-right: 2px; }
  & label:only-child { padding-right: 0; padding-left: 0; }
1322
  image { padding-top: 1px; }
1323 1324 1325
}


1326 1327 1328
/**************
 * Tree Views *
 **************/
1329
treeview.view {
1330 1331 1332 1333 1334 1335 1336 1337 1338
  -GtkTreeView-grid-line-width: 1;
  -GtkTreeView-grid-line-pattern: '';
  -GtkTreeView-tree-line-width: 1;
  -GtkTreeView-tree-line-pattern: '';
  -GtkTreeView-expander-size: 16;

  border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
  border-top-color: $bg_color;                         // while this is the grid lines color, better then nothing

1339
  & rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
1340

1341 1342 1343 1344
  &:selected {
    border-radius: 0;
    @extend %selected_items;
  }
1345 1346 1347 1348 1349 1350

  &:selected, &:backdrop:selected {
    border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
    border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunatelly
  }

1351
  &:disabled {
1352 1353 1354 1355 1356
    color: $insensitive_fg_color;
    &:selected {
      color: mix($selected_fg_color, $selected_bg_color, 40%);
      &:backdrop { color: mix($selected_fg_color, $selected_bg_color, 50%); }
    }
Jakub Steiner's avatar
Jakub Steiner committed
1357
    &:backdrop { color: $insensitive_fg_color; }
1358 1359 1360
  }

  &.separator:backdrop {
1361
    min-height: 2px;
1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
    color: transparentize(black, 0.9);
  }

  &:backdrop {
    color: $backdrop_fg_color;
    border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
    border-top: $backdrop_bg_color;
  }

  &.dnd {
    border-style: solid none;
    border-width: 1px;
    border-color: mix($fg_color, $selected_bg_color, 50%);
  }

  &.expander {
    -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
    &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
    color: mix($fg_color, $base_color, 70%);
    &:hover { color: $fg_color; }
    &:selected {
      color: mix($selected_fg_color, $selected_bg_color, 70%);
      &:hover { color: $selected_fg_color; }
      &:backdrop { color: mix($selected_fg_color, $selected_bg_color, 70%); }
    }

    &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }

    &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 70%); }
  }

  &.progressbar { // progress bar in treeviews
    color: $base_color;

    border: 1px solid $selected_borders_color;
    border-radius: 4px;
    background-color: $fg_color;

    &:selected { color: $selected_bg_color; }
      
    &:backdrop {
      color: $selected_bg_color;
      border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)  
      background-color: $backdrop_base_color;
    }
  }
  
  &.trough { // progress bar trough in treeviews
    background-color: transparentize($fg_color,0.9);
    border-radius: 4px;

    &:selected { 
      background-color: transparentize($selected_fg_color, 0.7);
      border-width: 1px 0;
      border-style: solid;
      border-color: $selected_bg_color;
    }
  }

1421 1422
  header {
    button {
1423
      @extend %column_header_button;
1424 1425 1426 1427
      $_column_header_color: mix($fg_color,$base_color,50%);
      color: $_column_header_color;
      font-weight: bold;
      text-shadow: none;
1428
      box-shadow: none;
1429 1430 1431 1432 1433 1434 1435 1436 1437
      &:hover {
        @extend %column_header_button;
        color: mix($_column_header_color,$fg_color,50%);
        box-shadow: none;
      }
      &:active {
        @extend %column_header_button;
        color: $selected_fg_color;
      }
1438
    }
1439 1440 1441
    & button:last-child,
    & button:last-child:hover,
    & button:last-child:backdrop { //treeview-like derived widgets in Banshee and Evolution
1442
      border-right-style: none;
1443 1444 1445 1446 1447
    }
  }
}

%column_header_button {
1448 1449
  padding: 3px 6px;
  border-style: none solid solid none;
1450
  border-radius: 0;
1451
  border-width: 1px;
1452
  background-image: none;
1453
  border-color: mix($backdrop_fg_color, $backdrop_bg_color,50%);
1454
  text-shadow: none;
1455
  &:disabled {
1456 1457 1458 1459
    border-color: $bg_color;
    background-image: none;
  }
  &:backdrop {
1460 1461
    border-color: mix($backdrop_fg_color, $backdrop_bg_color,50%);
    border-style: none solid solid none;
1462 1463
    color: mix($backdrop_fg_color, $backdrop_bg_color,50%);
    background-image: none;
1464
    background-color: $backdrop_base_color;
1465
    &:disabled {
1466 1467 1468 1469 1470
      border-color: $backdrop_bg_color;
      background-image: none;
    }
  }
}
1471 1472

treeview.view.progressbar { //Progressbar in treeview cells
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497
  color: $base_color;
  border-radius: 4px;
  background-image: linear-gradient(to bottom,
                                    $selected_bg_color,
                                    darken($selected_bg_color,10%));
  &:selected {
    color: $selected_bg_color;
    background-image: linear-gradient(to bottom,
                                     $base_color,
                                     darken($base_color,10%));
    &:backdrop {
      color: $selected_bg_color;
      background-image: none;
      background-color: $backdrop_base_color;
    }
  }
  &:backdrop {
    color: $backdrop_base_color;
    background-image: none;
  }
}

/*********
 * Menus *
 *********/
1498
menubar,
1499 1500
.menubar {
  padding: 0px;
1501
  box-shadow: inset 0 -1px $borders_color;
1502
  & > menuitem {
1503 1504 1505 1506 1507
    padding: 4px 8px;
    &:hover { //Seems like it :hover even with keyboard focus
      box-shadow: inset 0 -3px $selected_bg_color;
      color: $selected_bg_color;
    }
1508
    &:disabled {
1509 1510 1511 1512 1513 1514
      color: $insensitive_fg_color;
      box-shadow: none;
    }
  }
}

1515
menu,
1516
.menu {
1517
  margin: 4px;
1518 1519
  padding: 0px;
  background-color: $base_color;
1520 1521 1522
  border: 1px solid $borders_color;
  & menuitem {
    text-shadow: none;
1523
    padding: 4px;
1524
    min-width: 40px;
1525 1526 1527 1528
    &:hover {
      color: $selected_fg_color;
      background-color: $selected_bg_color;
    }
1529
    &:disabled {
1530
      color: $insensitive_fg_color;
1531
      &:backdrop { color: $insensitive_fg_color; }
1532 1533 1534 1535 1536 1537
    }
    &:backdrop, &:backdrop:hover {
      color: $backdrop_fg_color;
      background-color: $backdrop_base_color;
    }
    //submenu indicators
1538
    & arrow {
1539 1540
      min-height: 16px;
      min-width: 16px;
1541
    }
1542 1543 1544 1545
    & arrow:dir(ltr) {
      -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
      margin-left: 10px;
    }
1546
    & arrow:dir(rtl) {
1547
      -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl');
1548 1549
      margin-right: 10px;
    }
1550 1551
  }
}
1552

1553 1554 1555 1556 1557 1558 1559 1560 1561 1562
menuitem {
  & check,
  & radio {
    min-height: 16px;
    min-width: 16px;
    &:dir(ltr) { margin-right: 7px; }
    &:dir(rtl) { margin-left: 7px; }
  }
}

1563 1564 1565 1566
/***************
 * Popovers   *
 ***************/

1567
popover.background {
1568 1569
  padding: 2px;
  border-radius: 5px;
1570 1571 1572 1573 1574
  background-color: $popover_bg_color;

  &, .csd & { border: 1px solid $borders_color; }

  box-shadow: 0 1px 2px transparentize(black, 0.7);
1575 1576

  &:backdrop {
1577
    background-color: $backdrop_bg_color;
1578 1579
    box-shadow: none;
  }
1580 1581 1582 1583 1584

  > list,
  > .view,
  > toolbar {
    border-style: none;
1585 1586
    background-color: transparent;
  }
1587 1588 1589 1590 1591 1592 1593 1594 1595

  &, .csd & {
    &.touch-selection,
    &.magnifier {
      @extend %osd;

      border: 1px solid transparentize(white, 0.9);

      button { @extend %osd_button };
1596
    }
1597 1598

    &.osd { @extend %osd; }
1599
  }
1600 1601 1602 1603 1604 1605 1606

  separator { margin: 3px; }

  list separator { margin: 0px; }

  checkbutton,
  radiobutton { @extend modelbutton.flat; }
1607 1608 1609 1610 1611 1612 1613
}

/*****************
 * Notebooks and *
 * Tabs          *
 *****************/

1614
notebook {
1615 1616 1617 1618 1619 1620 1621
  // Through me you go to the grief wracked city;
  // Through me you go to everlasting pain;
  // Through me you go a pass among lost souls.
  // ...
  // Abandon all hope — Ye Who Enter Here
  padding: 0;
  background-color: $base_color;
1622 1623 1624 1625 1626 1627 1628 1629
  transition: all 200ms ease-out;
  &:backdrop {
    background-color: $backdrop_base_color;
  }
  &.frame {
    border: 1px solid $borders_color;
    &:backdrop { border-color: $backdrop_borders_color; }
  }
1630
  & header {
1631 1632 1633 1634 1635
    // FIXME: double borders in some case, can't fix it w/o a class tho
    // FIXME: doesn't work on dark var
    background-color: mix($bg_color, $borders_color, 70%);

    // this is the shading of the header behind the tabs
1636
    .frame & {
1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670
      border: 1px solid $borders_color;
      &.top { border-bottom-width: 0; }
      &.bottom { border-top-width: 0; }
      &.right { border-left-width: 0; }
      &.left { border-right-width: 0; }
      &:backdrop { border-color: $backdrop_borders_color; }
    }

    $_header_shade: inset 0 2px 3px -1px transparentize(black, 0.85);
    &.top {
      box-shadow: $_header_shade,
                  inset 0 -1px $borders_color; // border
      &:backdrop { box-shadow: inset 0 -1px $backdrop_borders_color; }
    }
    &.bottom {
      box-shadow: $_header_shade,
                  inset 0 1px $borders_color;
      &:backdrop { box-shadow: inset 0 1px $backdrop_borders_color; }
    }
    &.right {
      box-shadow: $_header_shade,
                  inset 1px 0 $borders_color;
      &:backdrop { box-shadow: inset 1px 0 $backdrop_borders_color; }
    }
    &.left {
      box-shadow: $_header_shade,
                  inset -1px 0 $borders_color;
      &:backdrop { box-shadow: inset -1px 0 $backdrop_borders_color; }
    }
    &:backdrop {
      // same color as backdrop pushed button
      background-color: mix($backdrop_borders_color,$backdrop_bg_color, 35%);
      box-shadow: none;
    }
1671 1672 1673
    & tabs arrow {
      color: $insensitive_fg_color;
      &:hover { color: mix($fg_color, $insensitive_fg_color, 50%); }
1674
      &:checked { color: $fg_color; }
1675
      &:disabled { color: transparentize($insensitive_fg_color,0.7); }
1676 1677
      &:backdrop { color: transparentize($backdrop_fg_color,0.6); }
    }
1678
  }
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689
  //vertical tab sizing
  $vt_vpadding: 8px;
  $vt_hpadding: 20px;
  // horizontal tab sizing
  $ht_vpadding: 5px;
  $ht_hpadding: 20px;
  $tab_indicator_size: 3px;

  & header.top tab {
    padding: $vt_vpadding $vt_hpadding;
    border-bottom-width: $tab_indicator_size;
1690
    &.reorderable-page {
1691 1692 1693 1694
      padding-left: 12px;  // for a nicer close button
      padding-right: 12px; // placement
      border-left-width: 1px;
      border-right-width: 1px;
1695
    }
1696 1697 1698 1699
  }
  & header.bottom tab {
    padding: $vt_vpadding $vt_hpadding;
    border-top-width: $tab_indicator_size;
1700
    &.reorderable-page {
1701 1702 1703 1704
      padding-left: 12px;  // for a nicer close button
      padding-right: 12px; // placement
      border-left-width: 1px;
      border-right-width: 1px;
1705
    }
1706 1707 1708 1709 1710 1711 1712
  }
  & header.left tab {
    padding: $ht_vpadding $ht_hpadding;
    border-right-width: $tab_indicator_size;
    &.reorderable-page {
      border-bottom-width: 1px;
      border-top-width: 1px;
1713
    }
1714 1715 1716 1717 1718 1719 1720
  }
  & header.right tab {
    padding: $ht_vpadding $ht_hpadding;
    border-left-width: $tab_indicator_size;
    &.reorderable-page {
      border-bottom-width: 1px;
      border-top-width: 1px;
1721
    }
1722 1723 1724 1725 1726 1727 1728 1729 1730
  }

  & tab {
    border-width: 0;
    border-style: solid;
    border-color: transparent;
    background-color: transparent;

    outline-offset: 0;
1731 1732

    //here's the interesting stuff
1733
    &:hover {
1734 1735
      border-color: $borders_color;
    }
1736
    &:checked, &:backdrop:checked {
1737 1738 1739 1740 1741 1742 1743 1744 1745 1746
      border-color: $selected_bg_color;
    }
    &:backdrop {
      background-color: transparent;
      border-color: transparent;
    }
    @each $_tab, $_border in (top, bottom),
                             (bottom, top),
                             (left, right),
                             (right, left) {
1747
      .#{$_tab} &.reorderable-page {
1748
        border-color: transparent;
1749
        &:hover {
1750 1751 1752 1753
          border-color: transparentize($borders_color,0.7);
          border-#{$_border}-color: $borders_color;
          background-color: transparentize($bg_color,0.8);
        }
1754
        &:checked {
1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770
          background-color: transparentize($bg_color,0.5);
          border-color: transparentize($borders_color,0.5);
          border-#{$_border}-color: $selected_bg_color;
          &:hover { background-color: transparentize($bg_color,0.3); }
          &:backdrop {
            border-color: $backdrop_borders_color;
            background-color: $backdrop_bg_color;
            border-#{$_border}-color: $selected_bg_color;
          }
        }
        &:backdrop {
          border-color: transparent;
          background-color: transparent;
        }
      }
    }
1771
    label { //tab text
1772 1773 1774
      padding: 0 2px; // needed for a nicer focus ring
      font-weight: bold;
      color: $insensitive_fg_color; /* color: inherit doesn't work here */
1775
      &:backdrop {
1776
        color: $insensitive_fg_color;
1777 1778
      }
    }
1779
    &:hover label {
1780 1781 1782
      // prelight tab text
      color: mix($fg_color, $insensitive_fg_color, 50%);
    }