scroll.less 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. @scroll-bar-width: 8px;
  2. @scroll-thin-width: 6px;
  3. .ace-scroll {
  4. overflow: hidden;
  5. }
  6. .scroll-content {
  7. position: static;
  8. overflow: hidden;
  9. }
  10. .scroll-disabled.ace-scroll {
  11. &, & .scroll-content {
  12. overflow: visible;
  13. }
  14. }
  15. .scroll-track {
  16. position: absolute;
  17. top: auto;
  18. bottom: auto;
  19. right: 0;
  20. //width: @scroll-bar-width;
  21. height: auto;// will be determined at runtime
  22. background-color: #E7E7E7;
  23. z-index: 99;//to appear above content
  24. width: 0;
  25. opacity: 0;
  26. }
  27. .scroll-bar {
  28. position: absolute;
  29. top: 0;
  30. left: 0;
  31. width: inherit;
  32. background-color: #ACE;
  33. background: saturate(darken(#CFDFEA , 5%), 5%);
  34. }
  35. .scroll-track.scroll-hz {
  36. top: auto;
  37. left: auto;
  38. right: auto;
  39. bottom: 0;
  40. height: @scroll-bar-width;
  41. width: auto;// will be determined at runtime
  42. }
  43. .scroll-hz .scroll-bar {
  44. height: inherit;
  45. width: auto;
  46. }
  47. .scroll-track.scroll-active {
  48. .transition(~"width 0.25s ease 0.75s, opacity 0.25s ease 0.75s");
  49. }
  50. .ace-scroll:hover .scroll-active,
  51. .scroll-active.scroll-track:hover,
  52. .scroll-active.scroll-track.scroll-hover,
  53. .scroll-active.scroll-track.active,
  54. .scroll-active.scroll-track:active
  55. {
  56. width: @scroll-bar-width;
  57. opacity: 1;
  58. .transition-duration(0.15s);
  59. .transition-delay(0s);
  60. }
  61. .scroll-track.active > .scroll-bar {
  62. transition-property: none !important;
  63. transition-duration: 0s !important;
  64. }
  65. //optional styling classes
  66. .scroll-track.scroll-margin {
  67. margin-left: -1px;
  68. }
  69. .scroll-track.scroll-left {
  70. right: auto;
  71. left: 0;
  72. &.scroll-margin {
  73. margin-left: 1px;
  74. }
  75. }
  76. //for horizontal
  77. .scroll-track.scroll-top {
  78. bottom: auto;
  79. top: 0;
  80. &.scroll-margin {
  81. top: 1px;
  82. }
  83. }
  84. .scroll-dark {
  85. .scroll-bar {
  86. background-color: transparent;
  87. background-color: rgba(0,0,0,0.25);
  88. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#40000000', endColorstr='#40000000',GradientType=0 )";
  89. }
  90. .scroll-track& {
  91. background-color: transparent;
  92. background-color: rgba(0,0,0,0.15);
  93. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#26000000', endColorstr='#26000000',GradientType=0 )";
  94. }
  95. }
  96. .scroll-light {
  97. .scroll-bar {
  98. background-color: transparent;
  99. background-color: rgba(0,0,0,0.14);
  100. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#24000000', endColorstr='#24000000',GradientType=0 )";
  101. }
  102. .scroll-track& {
  103. background-color: transparent;
  104. background-color: rgba(0,0,0,0.07);
  105. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#12000000', endColorstr='#12000000',GradientType=0 )";
  106. }
  107. }
  108. .scroll-white {
  109. .scroll-bar {
  110. background-color: transparent;
  111. background-color: rgba(255,255,255,0.33);
  112. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#55FFFFFF', endColorstr='#55FFFFFF',GradientType=0 )";
  113. }
  114. .scroll-track& {
  115. background-color: transparent;
  116. background-color: rgba(255,255,255,0.2);
  117. filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='#33FFFFFF', endColorstr='#33FFFFFF',GradientType=0 )";
  118. }
  119. }
  120. .no-track.scroll-track {
  121. background-color: transparent;
  122. filter: ~"progid:DXImageTransform.Microsoft.gradient( enabled=false )";
  123. }
  124. .scroll-visible {
  125. .scroll-track& {
  126. opacity: 1;
  127. width: @scroll-bar-width;
  128. }
  129. .scroll-hz& {
  130. height: @scroll-bar-width;
  131. width: auto;
  132. }
  133. }
  134. .scroll-thin.scroll-track {
  135. &:hover, &.scroll-hover, &:active, &.active, &.scroll-visible {
  136. width: @scroll-thin-width;
  137. }
  138. }
  139. .ace-scroll:hover .scroll-thin.scroll-track {
  140. width: @scroll-thin-width;
  141. }
  142. //horizontal
  143. .scroll-thin.scroll-hz {
  144. &:hover, &.scroll-hover, &:active, &.active, &.scroll-visible {
  145. width: auto;
  146. height: @scroll-thin-width;
  147. }
  148. }
  149. .ace-scroll:hover .scroll-thin.scroll-hz {
  150. width: auto;
  151. height: @scroll-thin-width;
  152. }
  153. //style like latest version of Chrome
  154. .scroll-chrome.scroll-active {
  155. .scroll-bar {
  156. background-color: transparent;
  157. width: 11px;
  158. &:before {
  159. display: block;
  160. content: "";
  161. position: absolute;
  162. top: 1px;
  163. bottom: 3px;
  164. left: 1px;
  165. right: 1px;
  166. background-color: #D9D9D9;
  167. border:1px solid #BBB;
  168. border-radius: 1px;
  169. }
  170. }
  171. .scroll-track {
  172. width: 12px;
  173. background-color: #F2F2F2;
  174. border: 1px solid;
  175. border-width: 1px 0 1px 1px;
  176. border-color: #E6E6E6 transparent #E6E6E6 #DBDBDB;
  177. &:hover {
  178. .scroll-bar:before {
  179. background-color: #C0C0C0;
  180. border-color: #A6A6A6;
  181. }
  182. }
  183. &.active {
  184. .scroll-bar:before {
  185. background-color: #A9A9A9;
  186. border-color: #8B8B8B;
  187. }
  188. }
  189. }
  190. }
  191. .scroll-active.scroll-track.idle-hide {
  192. opacity: 0;
  193. filter: ~"alpha(opacity=0)";
  194. width: @scroll-bar-width;//to make it hoverable
  195. &.not-idle {
  196. width: @scroll-bar-width;
  197. opacity: 1;
  198. filter: ~"alpha(opacity=100)";
  199. }
  200. }
  201. .scroll-active.scroll-thin.scroll-track.idle-hide {
  202. width: @scroll-thin-width;
  203. }
  204. .scroll-active.scroll-chrome .scroll-track.idle-hide {
  205. width: 12px;
  206. }
  207. //special nav-list scroller case
  208. .nav-wrap + .scroll-active .scroll-track {
  209. width: @scroll-bar-width;
  210. }
  211. .nav-scroll.scroll-active .scroll-track
  212. {
  213. width: @scroll-bar-width;
  214. right: 0;
  215. }
  216. .nav-wrap:hover + .scroll-active .scroll-track ,
  217. .nav-scroll.scroll-active:hover .scroll-track
  218. {
  219. width: @scroll-bar-width;
  220. opacity: 1;
  221. .transition-duration(0.15s);
  222. .transition-delay(0s);
  223. }
  224. .nav-scroll.scroll-active:hover .scroll-track {
  225. width: @scroll-bar-width;
  226. }
  227. .nav-scroll.ace-scroll {
  228. & , & .scroll-content {
  229. overflow: hidden;
  230. }
  231. }
  232. .nav-scroll.ace-scroll.scroll-disabled {
  233. & , & .scroll-content {
  234. overflow: visible;
  235. }
  236. }
  237. .scroll-track.scroll-detached {
  238. position: absolute;
  239. z-index: @zindex-navbar-fixed - 1;
  240. bottom: auto;
  241. right: auto;
  242. }