_sidebar.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. //
  2. // Sidebar
  3. //
  4. ._sidebar {
  5. position: absolute;
  6. z-index: $sidebarZ;
  7. top: 0;
  8. bottom: 0;
  9. left: 0;
  10. overflow-x: hidden;
  11. overflow-y: scroll;
  12. padding-top: $headerHeight;
  13. background: $sidebarBackground;
  14. background-clip: content-box;
  15. -webkit-overflow-scrolling: touch;
  16. -ms-overflow-style: none; // IE 10 doesn't support pointer-events
  17. @extend %border-box;
  18. @extend %user-select-none;
  19. ._overlay-scrollbars & {
  20. padding-top: 0;
  21. top: $headerHeight;
  22. }
  23. body:not(._native-scrollbars) & {
  24. &::-webkit-scrollbar { width: 10px; }
  25. &::-webkit-scrollbar-track {
  26. background: $contentBackground;
  27. border: 0;
  28. }
  29. &::-webkit-scrollbar-thumb {
  30. border-width: 3px;
  31. &:hover, &:active { border-width: 2px; }
  32. }
  33. }
  34. ._sidebar-hidden & { display: none; }
  35. &.show { display: block; }
  36. }
  37. ._resizer {
  38. position: absolute;
  39. z-index: $sidebarZ + 1;
  40. top: $headerHeight;
  41. bottom: $headerHeight;
  42. left: $sidebarWidth;
  43. margin-left: -2px;
  44. width: 3px;
  45. cursor: col-resize;
  46. ._sidebar-hidden & { display: none; }
  47. ._sidebar-hidden ._sidebar.show ~ & { display: block; }
  48. }
  49. //
  50. // List
  51. //
  52. ._list {
  53. margin: 0;
  54. padding: 0;
  55. list-style: none;
  56. width: $sidebarWidth;
  57. box-shadow: inset -1px 0 $sidebarBorder;
  58. @extend %border-box;
  59. @media #{$mediumScreen} { width: $sidebarMediumWidth; }
  60. ._sidebar > & { min-height: 100%; }
  61. a:focus { outline: 0; }
  62. }
  63. ._list-title {
  64. position: relative;
  65. margin: .5rem 0 0;
  66. padding-left: 2.25rem;
  67. line-height: 2rem;
  68. font-size: .75rem;
  69. color: $textColorLight;
  70. text-transform: uppercase;
  71. cursor: default;
  72. }
  73. ._list-item {
  74. display: block;
  75. position: relative;
  76. padding: .25rem .75rem;
  77. line-height: 1.5rem;
  78. font-size: .875rem;
  79. cursor: default;
  80. background: $sidebarBackground;
  81. box-shadow: inset -1px 0 $sidebarBorder;
  82. @extend %truncate-text;
  83. &, &:hover {
  84. color: inherit;
  85. text-decoration: none;
  86. }
  87. &.focus,
  88. &.focus:hover,
  89. &.active,
  90. &.active:hover {
  91. color: $focusText;
  92. background: $focusBackground;
  93. box-shadow: inset -1px 0 $focusBorder;
  94. }
  95. &.active,
  96. &.active:hover {
  97. color: $selectionText;
  98. background: $selectionBackground;
  99. box-shadow: inset -1px 0 $selectionBorder;
  100. }
  101. &:before {
  102. float: left;
  103. margin: .25rem .625rem 0 0;
  104. @extend %doc-icon;
  105. }
  106. }
  107. ._list-text {
  108. display: block;
  109. pointer-events: none;
  110. @extend %truncate-text;
  111. }
  112. ._list-count, ._list-enable {
  113. float: right;
  114. font-size: .75rem;
  115. margin-left: .375rem;
  116. .focus > &,
  117. .active > & {
  118. color: inherit;
  119. }
  120. }
  121. ._list-count {
  122. color: $textColorLighter;
  123. pointer-events: none;
  124. ._list-disabled:hover > & { display: none; }
  125. }
  126. ._list-enable {
  127. display: none;
  128. color: $linkColor;
  129. cursor: pointer;
  130. &:hover { text-decoration: underline; }
  131. ._list-disabled:hover > &, ._list-result > & { display: block; }
  132. ._list-result.active > & { margin-right: -1rem; }
  133. }
  134. //
  135. // List hierarchy
  136. //
  137. ._list-dir:not(._list-rdir),
  138. %_list-dir {
  139. padding-left: 2.125rem;
  140. }
  141. ._list-disabled {
  142. @extend %_list-dir;
  143. &, &:hover { color: $textColorLight; }
  144. &:before { opacity: .7; }
  145. }
  146. ._list-arrow {
  147. position: absolute;
  148. top: 0;
  149. left: .25rem;
  150. padding: .5rem .375rem .5rem .5rem;
  151. width: 1rem;
  152. height: 1rem;
  153. cursor: pointer;
  154. fill: black;
  155. opacity: .4;
  156. @if $style == 'dark' { fill: white; }
  157. &:hover { opacity: .65; }
  158. ._list-rdir > & {
  159. left: auto;
  160. right: .25rem;
  161. }
  162. .open > &, .open-title > & {
  163. -webkit-transform: rotate(90deg);
  164. transform: rotate(90deg);
  165. }
  166. }
  167. ._list-sub {
  168. display: none;
  169. .open + & { display: block; }
  170. > ._list-item { padding-left: 2.375rem; }
  171. > ._list-dir, > ._list-sub > ._list-item { padding-left: 2.75rem; }
  172. > ._list-disabled { padding-left: 3.875rem; }
  173. > ._list-item:before { content: none; }
  174. > ._list-dir { line-height: 1.375rem; }
  175. ._list-arrow {
  176. left: 1rem;
  177. padding: .4375rem;
  178. }
  179. }
  180. //
  181. // List pagination
  182. //
  183. ._list-pagelink {
  184. color: $linkColor;
  185. cursor: pointer;
  186. &:hover {
  187. color: $linkColorHover;
  188. text-decoration: underline;
  189. }
  190. }
  191. //
  192. // Search results
  193. //
  194. ._list-result.active {
  195. padding-right: 1.75rem;
  196. > ._list-reveal { display: block; }
  197. > ._list-count { display: none; }
  198. }
  199. ._list-reveal {
  200. display: none;
  201. position: absolute;
  202. top: 0;
  203. bottom: 0;
  204. right: 0;
  205. width: 2rem;
  206. cursor: pointer;
  207. &:before {
  208. content: '';
  209. position: absolute;
  210. bottom: 50%;
  211. left: .75rem;
  212. width: .75rem;
  213. height: 1px;
  214. background: rgba($selectionText, .9);
  215. box-shadow: 0 -3px rgba($selectionText, .9), // top line
  216. 0 3px rgba($selectionText, .9); // bottom line
  217. }
  218. }
  219. //
  220. // List note
  221. //
  222. ._list-note {
  223. padding: .5rem .75rem;
  224. line-height: 1.25rem;
  225. font-size: .8125rem;
  226. color: $textColorLight;
  227. & + & { padding-top: 0; }
  228. }
  229. ._list-note-link { cursor: pointer; }
  230. //
  231. // List hover clone
  232. //
  233. ._list-hover.clone {
  234. position: fixed;
  235. overflow: visible;
  236. z-index: $hoverZ;
  237. left: 0;
  238. min-width: $sidebarWidth;
  239. padding: .25rem .75rem;
  240. pointer-events: none;
  241. -webkit-font-smoothing: subpixel-antialiased;
  242. -webkit-transform: translate3d(0, 0, 0);
  243. transform: translate3d(0, 0, 0);
  244. @extend %border-box;
  245. @media #{$mediumScreen} { min-width: $sidebarMediumWidth; }
  246. > ._list-text { display: inline; }
  247. &:not(._list-result) {
  248. padding-left: 2.75rem;
  249. &:before { content: none; }
  250. }
  251. ._list-reveal, ._list-enable { display: none; }
  252. }
  253. //
  254. // List picker
  255. //
  256. ._list-picker {
  257. > ._list, > ._list-item {
  258. opacity: 0;
  259. transition: opacity .2s;
  260. }
  261. &._in { > ._list, > ._list-item { opacity: 1; } }
  262. ._list-item { cursor: pointer; }
  263. ._list-sub > ._list-item { padding-left: 2.375rem; }
  264. }
  265. ._list-checkbox {
  266. position: absolute;
  267. top: .5rem;
  268. right: .75rem;
  269. }
  270. ._list-link {
  271. display: block;
  272. padding: .75rem 0;
  273. font-size: .8125rem;
  274. text-align: center;
  275. @extend %external-link;
  276. &:after { visibility: hidden; }
  277. &:hover:after { visibility: visible; }
  278. }