_header.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. //
  2. // Header
  3. //
  4. ._header {
  5. position: absolute;
  6. z-index: var(--headerZ);
  7. top: 0;
  8. left: 0;
  9. display: -ms-flexbox;
  10. display: flex;
  11. width: var(--sidebarWidth);
  12. height: var(--headerHeight);
  13. background: var(--headerBackground);
  14. border-bottom: 1px solid var(--headerBorder);
  15. border-right: 1px solid var(--headerBorder);
  16. @extend %border-box;
  17. @extend %user-select-none;
  18. @include mobile { width: var(--sidebarMediumWidth); }
  19. }
  20. ._header-left {
  21. float: left;
  22. height: 100%;
  23. }
  24. ._header-right {
  25. float: right;
  26. height: 100%;
  27. }
  28. ._header-btn {
  29. position: relative;
  30. flex: 0 0 auto;
  31. width: 2.25rem;
  32. height: 100%;
  33. color: var(--textColorLight);
  34. text-align: center;
  35. &[hidden] { display: none; }
  36. &[disabled] {
  37. opacity: .3;
  38. cursor: not-allowed;
  39. }
  40. > svg {
  41. width: 1.5rem;
  42. height: 1.5rem;
  43. @extend %svg-icon;
  44. }
  45. }
  46. //
  47. // Menu
  48. //
  49. ._menu {
  50. position: absolute;
  51. z-index: 1;
  52. top: .25rem;
  53. right: .25rem;
  54. width: 8.5rem;
  55. height: calc(13.75rem + 1px);
  56. white-space: nowrap;
  57. word-wrap: normal;
  58. overflow-wrap: normal;
  59. font-size: .875rem;
  60. background: var(--contentBackground);
  61. border: 1px solid var(--headerBorder);
  62. border-radius: 3px;
  63. box-shadow: -1px 1px 1px rgba(black, .05);
  64. transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
  65. opacity: 0;
  66. -webkit-transform: scale(0, 0);
  67. transform: scale(0, 0);
  68. -webkit-transform-origin: 100% 0;
  69. transform-origin: 100% 0;
  70. &.active {
  71. transition-duration: 250ms;
  72. opacity: 1;
  73. -webkit-transform: scale(1, 1);
  74. transform: scale(1, 1);
  75. }
  76. &:focus-within,
  77. ._menu-btn:focus + & {
  78. transition-duration: 250ms;
  79. opacity: 1;
  80. -webkit-transform: scale(1, 1);
  81. transform: scale(1, 1);
  82. }
  83. }
  84. ._menu-title {
  85. margin: 0;
  86. line-height: 1.5rem;
  87. font-size: 1rem;
  88. font-weight: var(--boldFontWeight);
  89. letter-spacing: -.5px;
  90. background: var(--sidebarBackground);
  91. border-bottom: 1px solid var(--sidebarBorder);
  92. border-radius: 2px 2px 0 0;
  93. }
  94. ._menu-title-link,
  95. ._menu-title-link:hover {
  96. display: block;
  97. padding: .5rem 1rem;
  98. color: var(--focusText);
  99. text-decoration: none;
  100. }
  101. ._menu-link {
  102. display: block;
  103. padding: 0 1rem;
  104. line-height: 2.25rem;
  105. color: inherit;
  106. text-decoration: none;
  107. &:hover {
  108. color: var(--focusText);
  109. text-decoration: none;
  110. background: var(--sidebarBackground);
  111. }
  112. &:last-child { border-radius: 0 0 2px 2px; }
  113. }
  114. //
  115. // Search form
  116. //
  117. ._search {
  118. -ms-flex: 1 1 auto;
  119. flex: 1 1 auto;
  120. position: relative;
  121. height: 100%;
  122. padding: .5rem 0 .5rem .5rem;
  123. @extend %border-box;
  124. > svg {
  125. position: absolute;
  126. z-index: 1;
  127. top: .875rem;
  128. left: .875rem;
  129. width: 1.25rem;
  130. height: 1.25rem;
  131. opacity: .42;
  132. @extend %svg-icon;
  133. fill: var(--absolute);
  134. }
  135. }
  136. ._search-input {
  137. position: relative;
  138. display: block;
  139. width: 100%;
  140. height: 100%;
  141. padding: 0 .75rem 1px 1.75rem;
  142. font-size: .875rem;
  143. background: var(--contentBackground);
  144. border: 1px solid;
  145. border-color: var(--searchBorder);
  146. border-radius: 3px;
  147. &:focus {
  148. outline: 0;
  149. border-color: var(--inputFocusBorder);
  150. box-shadow: 0 0 1px var(--inputFocusBorder);
  151. }
  152. &[disabled] {
  153. background: var(--sidebarBackground);
  154. cursor: not-allowed;
  155. }
  156. }
  157. ._search-clear {
  158. display: none;
  159. position: absolute;
  160. top: .5em;
  161. right: 0;
  162. width: 1.75rem;
  163. height: 2rem;
  164. opacity: .42;
  165. @extend %hide-text;
  166. &:hover { opacity: .7; }
  167. > svg {
  168. position: absolute;
  169. top: .5rem;
  170. left: .375rem;
  171. @extend %svg-icon;
  172. fill: var(--absolute);
  173. }
  174. ._search-active > & { display: block; }
  175. }
  176. ._search-tag {
  177. display: none;
  178. position: absolute;
  179. z-index: 2;
  180. top: .875rem;
  181. left: .875rem;
  182. padding: 0 .375rem;
  183. line-height: 1.25rem;
  184. max-width: 50%;
  185. font-size: .8125rem;
  186. color: var(--textColorLight);
  187. background: var(--searchTagBackground);
  188. border-radius: 2px;
  189. cursor: pointer;
  190. @extend %truncate-text;
  191. }