_sidebar.scss 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. //
  2. // Sidebar
  3. //
  4. ._sidebar {
  5. position: absolute;
  6. z-index: $sidebarZ;
  7. top: $headerHeight;
  8. bottom: 0;
  9. left: 0;
  10. margin-top: 1px;
  11. overflow-x: hidden;
  12. overflow-y: scroll;
  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 %user-select-none;
  18. &::-webkit-scrollbar { -webkit-appearance: none; width: 10px; }
  19. &::-webkit-scrollbar-button { display: none; }
  20. &::-webkit-scrollbar-track { background: $contentBackground; }
  21. &::-webkit-scrollbar-thumb {
  22. min-height: 2rem;
  23. background: $scrollbarColor;
  24. background-clip: padding-box;
  25. border: 3px solid $contentBackground;
  26. border-radius: 5px;
  27. &:active {
  28. background-color: $scrollbarColorHover;
  29. border-width: 2px;
  30. }
  31. }
  32. ._sidebar-hidden & {
  33. display: none;
  34. }
  35. }
  36. ._resizer {
  37. position: absolute;
  38. z-index: $sidebarZ;
  39. top: $headerHeight;
  40. bottom: 0;
  41. left: $sidebarWidth;
  42. margin-left: -2px;
  43. width: 3px;
  44. cursor: col-resize;
  45. ._sidebar-hidden & {
  46. left: 0;
  47. margin-left: 0;
  48. background: $headerBackground;
  49. border-right: 1px solid $headerBorder;
  50. width: 8px;
  51. cursor: pointer;
  52. &:before {
  53. content: '';
  54. position: absolute;
  55. top: 50%;
  56. left: 3px;
  57. margin-top: -.5rem;
  58. width: 1px;
  59. height: 1rem;
  60. border-left: 1px solid $textColorLighter;
  61. border-right: 1px solid $textColorLighter;
  62. }
  63. }
  64. }
  65. //
  66. // List
  67. //
  68. ._list {
  69. margin: 0;
  70. padding: 0;
  71. list-style: none;
  72. width: $sidebarWidth;
  73. box-shadow: inset -1px 0 $sidebarBorder;
  74. @extend %border-box;
  75. @media #{$mediumScreen} { width: $sidebarMediumWidth; }
  76. ._sidebar > & {
  77. min-height: 100%;
  78. padding-bottom: 3.5rem;
  79. }
  80. a:focus { outline: 0; }
  81. }
  82. ._list-title {
  83. position: relative;
  84. margin: .5rem 0 0;
  85. padding-left: 2.25rem;
  86. line-height: 2rem;
  87. font-size: .75rem;
  88. color: $textColorLight;
  89. text-transform: uppercase;
  90. cursor: default;
  91. }
  92. ._list-item {
  93. display: block;
  94. position: relative;
  95. padding: .25rem .75rem;
  96. line-height: 1.5rem;
  97. font-size: .875rem;
  98. cursor: default;
  99. background: $sidebarBackground;
  100. box-shadow: inset -1px 0 $sidebarBorder;
  101. &, &:hover {
  102. color: inherit;
  103. text-decoration: none;
  104. }
  105. &.focus,
  106. &.focus:hover,
  107. &.active,
  108. &.active:hover {
  109. color: $focusText;
  110. background: $focusBackground;
  111. box-shadow: inset -1px 0 $focusBorder;
  112. }
  113. &.active,
  114. &.active:hover {
  115. color: $selectionText;
  116. background: $selectionBackground;
  117. box-shadow: inset -1px 0 $selectionBorder;
  118. }
  119. &:before {
  120. float: left;
  121. margin: .25rem .625rem 0 0;
  122. @extend %doc-icon;
  123. }
  124. }
  125. ._list-item, ._list-text {
  126. overflow: hidden;
  127. white-space: nowrap;
  128. word-wrap: normal;
  129. overflow-wrap: normal;
  130. text-overflow: ellipsis;
  131. }
  132. ._list-text {
  133. display: block;
  134. pointer-events: none;
  135. }
  136. ._list-count, ._list-enable {
  137. float: right;
  138. font-size: .75rem;
  139. margin-left: .375rem;
  140. .focus > &,
  141. .active > & {
  142. color: inherit;
  143. }
  144. }
  145. ._list-count {
  146. color: $textColorLighter;
  147. pointer-events: none;
  148. ._list-disabled:hover > & { display: none; }
  149. }
  150. ._list-enable {
  151. display: none;
  152. color: $linkColor;
  153. cursor: pointer;
  154. &:hover { text-decoration: underline; }
  155. ._list-disabled:hover > &, ._list-result > & { display: block; }
  156. ._list-result.active > & { margin-right: -1rem; }
  157. }
  158. //
  159. // List hierarchy
  160. //
  161. ._list-dir:not(._list-rdir),
  162. %_list-dir {
  163. padding-left: 2.25rem;
  164. }
  165. ._list-disabled {
  166. @extend %_list-dir;
  167. &, &:hover { color: $textColorLight; }
  168. &:before { opacity: .7; }
  169. }
  170. ._list-arrow {
  171. position: absolute;
  172. top: 0;
  173. left: .25rem;
  174. padding: .5rem;
  175. cursor: pointer;
  176. opacity: .4;
  177. &:hover { opacity: .65; }
  178. ._list-rdir > & {
  179. left: auto;
  180. right: .25rem;
  181. }
  182. &:before {
  183. @if $style == 'dark' {
  184. @extend %icon, %icon-dir-white;
  185. } @else {
  186. @extend %icon, %icon-dir;
  187. }
  188. .open > &, .open-title > & {
  189. -webkit-transform: rotate(90deg);
  190. transform: rotate(90deg);
  191. }
  192. }
  193. }
  194. ._list-sub {
  195. display: none;
  196. .open + & { display: block; }
  197. > ._list-item { padding-left: 2.375rem; }
  198. > ._list-dir, > ._list-sub > ._list-item { padding-left: 2.75rem; }
  199. > ._list-disabled { padding-left: 3.875rem; }
  200. > ._list-item:before { content: none; }
  201. > ._list-dir { line-height: 1.375rem; }
  202. ._list-arrow {
  203. left: 1rem;
  204. padding: .4375rem;
  205. }
  206. }
  207. //
  208. // List pagination
  209. //
  210. ._list-pagelink {
  211. color: $linkColor;
  212. cursor: pointer;
  213. &:hover {
  214. color: $linkColorHover;
  215. text-decoration: underline;
  216. }
  217. }
  218. //
  219. // Search results
  220. //
  221. ._list-result.active {
  222. padding-right: 1.75rem;
  223. > ._list-reveal { display: block; }
  224. > ._list-count { display: none; }
  225. }
  226. ._list-reveal {
  227. display: none;
  228. position: absolute;
  229. top: 0;
  230. bottom: 0;
  231. right: 0;
  232. width: 2rem;
  233. cursor: pointer;
  234. &:before {
  235. content: '';
  236. position: absolute;
  237. bottom: 50%;
  238. left: .75rem;
  239. width: .75rem;
  240. height: 1px;
  241. background: rgba($selectionText, .9);
  242. box-shadow: 0 -3px rgba($selectionText, .9), // top line
  243. 0 3px rgba($selectionText, .9); // bottom line
  244. }
  245. }
  246. //
  247. // List note
  248. //
  249. ._list-note {
  250. padding: .5rem .75rem;
  251. line-height: 1.25rem;
  252. font-size: .8125rem;
  253. color: $textColorLight;
  254. & + & { padding-top: 0; }
  255. }
  256. ._list-note-link { cursor: pointer; }
  257. //
  258. // List hover clone
  259. //
  260. ._list-hover.clone {
  261. position: fixed;
  262. overflow: visible;
  263. z-index: $hoverZ;
  264. left: 0;
  265. min-width: $sidebarWidth;
  266. padding: .25rem .75rem;
  267. pointer-events: none;
  268. -webkit-font-smoothing: subpixel-antialiased;
  269. -webkit-transform: translate3d(0, 0, 0);
  270. transform: translate3d(0, 0, 0);
  271. @extend %border-box;
  272. @media #{$mediumScreen} { min-width: $sidebarMediumWidth; }
  273. > ._list-text { display: inline; }
  274. &:not(._list-result) {
  275. padding-left: 2.75rem;
  276. &:before { content: none; }
  277. }
  278. ._list-reveal, ._list-enable { display: none; }
  279. }
  280. //
  281. // List picker
  282. //
  283. ._list-picker {
  284. > ._list, > ._list-item {
  285. opacity: 0;
  286. transition: .2s;
  287. }
  288. &._in { > ._list, > ._list-item { opacity: 1; } }
  289. ._list-item { cursor: pointer; }
  290. ._list-sub > ._list-item { padding-left: 2.375rem; }
  291. }
  292. ._list-checkbox {
  293. position: absolute;
  294. top: .5rem;
  295. right: .75rem;
  296. width: 1rem;
  297. height: 1rem;
  298. transition: .2s;
  299. }
  300. ._list-link {
  301. display: block;
  302. margin-top: .75rem;
  303. font-size: .8125rem;
  304. text-align: center;
  305. @extend %external-link;
  306. &:after { visibility: hidden; }
  307. &:hover:after { visibility: visible; }
  308. }
  309. //
  310. // Footer
  311. //
  312. ._sidebar-footer {
  313. position: fixed;
  314. bottom: 0;
  315. left: 0;
  316. width: $sidebarWidth;
  317. background: $sidebarBackground;
  318. box-shadow: inset -1px 0 $sidebarBorder;
  319. -webkit-transform: translateZ(0);
  320. transform: translateZ(0);
  321. @media #{$mediumScreen} { width: $sidebarMediumWidth; }
  322. ._max-width & {
  323. left: calc(50% - #{$maxWidth} / 2);
  324. @media (max-width: #{$maxWidth}) { left: 0; }
  325. }
  326. &:before {
  327. content: '';
  328. position: absolute;
  329. bottom: 100%;
  330. left: 0;
  331. right: 1px;
  332. height: 1em;
  333. background-image: -webkit-linear-gradient(top, rgba($sidebarBackground, 0), rgba($sidebarBackground, .95));
  334. background-image: linear-gradient(to bottom, rgba($sidebarBackground, 0), rgba($sidebarBackground, .95));
  335. pointer-events: none;
  336. }
  337. }
  338. ._sidebar-footer-link {
  339. position: relative;
  340. display: block;
  341. overflow: hidden;
  342. height: 2.5rem;
  343. line-height: 1rem;
  344. padding: .75rem .25rem .75rem .75rem;
  345. font-size: .875em;
  346. cursor: pointer;
  347. @extend %border-box;
  348. &, &:hover {
  349. color: inherit;
  350. text-decoration: none;
  351. }
  352. &:before {
  353. float: left;
  354. margin-right: .625rem;
  355. @extend %icon;
  356. }
  357. }
  358. ._sidebar-footer-edit {
  359. display: inline-block;
  360. @if $style == 'dark' {
  361. &:before { @extend %icon-settings-white; }
  362. } @else {
  363. &:before { @extend %icon-settings; }
  364. }
  365. }
  366. ._sidebar-footer-light {
  367. float: right;
  368. width: 2rem;
  369. padding: 0;
  370. opacity: .65;
  371. @extend %hide-text;
  372. &:before {
  373. float: none;
  374. position: absolute;
  375. top: .75rem;
  376. left: .25rem;
  377. @if $style == 'dark' {
  378. @extend %icon-light-white;
  379. } @else {
  380. @extend %icon-light;
  381. }
  382. }
  383. }
  384. ._sidebar-footer-layout {
  385. float: right;
  386. width: 2rem;
  387. padding: 0;
  388. opacity: .65;
  389. @extend %hide-text;
  390. &:before {
  391. float: none;
  392. position: absolute;
  393. top: .75rem;
  394. left: .375rem;
  395. @if $style == 'dark' {
  396. @extend %icon-expand-white;
  397. } @else {
  398. @extend %icon-expand;
  399. }
  400. ._max-width & {
  401. @if $style == 'dark' {
  402. @extend %icon-contract-white;
  403. } @else {
  404. @extend %icon-contract;
  405. }
  406. }
  407. }
  408. @media (max-width: #{$maxWidth + .1rem}) { display: none; }
  409. }
  410. ._sidebar-footer-save {
  411. margin-right: 1px;
  412. font-weight: $boldFontWeight;
  413. background: $noteGreenBackground;
  414. box-shadow: inset 0 1px $noteGreenBorder,
  415. 1px 0 $noteGreenBorder;
  416. @if $style == 'dark' {
  417. &:before { @extend %icon-check-white; }
  418. } @else {
  419. &:before { @extend %icon-check; }
  420. }
  421. }