_header.scss 4.0 KB

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