_scrollbars.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /**************
  2. * Scrollbars *
  3. **************/
  4. scrollbar {
  5. $_slider_min_length: 40px;
  6. background-color: $scrollbar_bg_color;
  7. transition: 300ms $ease-out-quad;
  8. // scrollbar border
  9. &.top { border-bottom: 1px solid $borders_color; }
  10. &.bottom { border-top: 1px solid $borders_color; }
  11. &.left { border-right: 1px solid $borders_color; }
  12. &.right { border-left: 1px solid $borders_color; }
  13. &:backdrop {
  14. background-color: $backdrop_scrollbar_bg_color;
  15. border-color: $backdrop_borders_color;
  16. transition: $backdrop_transition;
  17. }
  18. // slider
  19. slider {
  20. min-width: 6px;
  21. min-height: 6px;
  22. margin: -1px;
  23. border: 4px solid transparent;
  24. border-radius: 8px;
  25. background-clip: padding-box;
  26. background-color: $scrollbar_slider_color;
  27. &:hover { background-color: $scrollbar_slider_hover_color; }
  28. &:hover:active { background-color: $scrollbar_slider_active_color; }
  29. &:backdrop { background-color: $backdrop_scrollbar_slider_color; }
  30. &:disabled { background-color: transparent; }
  31. }
  32. &.fine-tune {
  33. slider {
  34. min-width: 4px;
  35. min-height: 4px;
  36. }
  37. &.horizontal slider { border-width: 5px 4px; }
  38. &.vertical slider { border-width: 4px 5px; }
  39. }
  40. &.overlay-indicator {
  41. &:not(.dragging):not(.hovering) {
  42. border-color: transparent;
  43. opacity: 0.4;
  44. background-color: transparent;
  45. slider {
  46. margin: 0;
  47. min-width: 3px;
  48. min-height: 3px;
  49. background-color: $fg_color;
  50. border: 1px solid if($variant == 'light', white, black);
  51. }
  52. button {
  53. min-width: 5px;
  54. min-height: 5px;
  55. background-color: $fg_color;
  56. background-clip: padding-box;
  57. border-radius: 100%;
  58. border: 1px solid if($variant == 'light', white, black);
  59. -gtk-icon-source: none;
  60. }
  61. &.horizontal {
  62. slider {
  63. margin: 0 2px;
  64. min-width: $_slider_min_length;
  65. }
  66. button {
  67. margin: 1px 2px;
  68. min-width: 5px;
  69. }
  70. }
  71. &.vertical {
  72. slider {
  73. margin: 2px 0;
  74. min-height: $_slider_min_length;
  75. }
  76. button {
  77. margin: 2px 1px;
  78. min-height: 5px;
  79. }
  80. }
  81. }
  82. &.dragging,
  83. &.hovering { opacity: 0.8; }
  84. }
  85. &.horizontal slider { min-width: $_slider_min_length; }
  86. &.vertical slider { min-height: $_slider_min_length; }
  87. // button styling
  88. button {
  89. padding: 0;
  90. min-width: 12px;
  91. min-height: 12px;
  92. border-style: none;
  93. border-radius: 0;
  94. transition-property: min-height, min-width, color;
  95. @include button(undecorated);
  96. color: $scrollbar_slider_color;
  97. &:hover {
  98. @include button(undecorated);
  99. color: $scrollbar_slider_hover_color;
  100. }
  101. &:active, &:checked {
  102. @include button(undecorated);
  103. color: $scrollbar_slider_active_color;
  104. }
  105. &:disabled {
  106. @include button(undecorated);
  107. color: transparentize($scrollbar_slider_color, 0.8);
  108. }
  109. &:backdrop {
  110. @include button(undecorated);
  111. color: $backdrop_scrollbar_slider_color;
  112. &:disabled {
  113. @include button(undecorated);
  114. color: transparentize($backdrop_scrollbar_slider_color, 0.8);
  115. }
  116. }
  117. }
  118. // button icons
  119. &.vertical {
  120. button {
  121. &.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  122. &.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
  123. }
  124. }
  125. &.horizontal {
  126. button {
  127. &.down { -gtk-icon-source: -gtk-icontheme('pan-right-symbolic'); }
  128. &.up { -gtk-icon-source: -gtk-icontheme('pan-left-symbolic'); }
  129. }
  130. }
  131. }
  132. treeview ~ scrollbar.vertical {
  133. border-top: 1px solid $borders_color;
  134. margin-top: -1px;
  135. }