_header.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. //
  2. // Header
  3. //
  4. ._header {
  5. position: absolute;
  6. z-index: $headerZ;
  7. top: 0;
  8. left: 0;
  9. display: flex;
  10. width: $sidebarWidth;
  11. height: $headerHeight;
  12. background: $headerBackground;
  13. border-bottom: 1px solid $headerBorder;
  14. @extend %user-select-none;
  15. @media #{$mediumScreen} { width: $sidebarMediumWidth; }
  16. }
  17. ._header-left {
  18. float: left;
  19. height: 100%;
  20. }
  21. ._header-right {
  22. float: right;
  23. height: 100%;
  24. }
  25. ._header-btn {
  26. position: relative;
  27. width: 2.25rem;
  28. height: 100%;
  29. color: $textColorLight;
  30. text-align: center;
  31. &[hidden] { display: none; }
  32. &[disabled] {
  33. opacity: .3;
  34. cursor: not-allowed;
  35. }
  36. > svg {
  37. display: inline-block;
  38. vertical-align: top;
  39. width: 1.5rem;
  40. height: 1.5rem;
  41. fill: currentColor;
  42. pointer-events: none;
  43. }
  44. }
  45. //
  46. // Menu
  47. //
  48. ._menu-btn {
  49. border-right: 1px solid $headerBorder;
  50. }
  51. ._menu {
  52. position: absolute;
  53. z-index: 1;
  54. top: .25rem;
  55. right: .25rem;
  56. width: 8rem;
  57. height: calc(11.5rem + 1px);
  58. font-size: .875rem;
  59. background: $contentBackground;
  60. border: 1px solid $headerBorder;
  61. border-radius: 3px;
  62. box-shadow: -1px 1px 1px rgba(black, .05);
  63. transition: all 250ms cubic-bezier(0.23, 1, 0.32, 1);
  64. opacity: 0;
  65. -webkit-transform: scale(0, 0);
  66. transform: scale(0, 0);
  67. -webkit-transform-origin: 100% 0;
  68. transform-origin: 100% 0;
  69. &:hover,
  70. ._menu-btn:hover + & {
  71. transition-delay: 100ms;
  72. }
  73. &:hover,
  74. &.active,
  75. ._menu-btn:hover + &,
  76. ._menu-btn:focus + & {
  77. opacity: 1;
  78. -webkit-transform: scale(1, 1);
  79. transform: scale(1, 1);
  80. }
  81. &:focus-within {
  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. flex-grow: 1;
  122. position: relative;
  123. height: 100%;
  124. padding: .5rem 0 .5rem .5rem;
  125. @extend %border-box;
  126. &:before {
  127. position: absolute;
  128. z-index: 1;
  129. top: 1rem;
  130. left: 1rem;
  131. opacity: .4;
  132. pointer-events: none;
  133. @if $style == 'dark' {
  134. @extend %icon, %icon-search-white;
  135. } @else {
  136. @extend %icon, %icon-search;
  137. }
  138. }
  139. }
  140. ._search-input {
  141. position: relative;
  142. display: block;
  143. width: 100%;
  144. height: 100%;
  145. padding: 0 .75rem 1px 1.75rem;
  146. font-size: .875rem;
  147. background: $contentBackground;
  148. border: 1px solid;
  149. border-color: darken($headerBorder, 2%);
  150. border-radius: 3px;
  151. &:focus {
  152. outline: 0;
  153. @if $inputFocusBorder {
  154. border-color: $inputFocusBorder;
  155. box-shadow: 0 0 1px $inputFocusBorder;
  156. }
  157. }
  158. &[disabled] {
  159. background: $sidebarBackground;
  160. cursor: not-allowed;
  161. }
  162. }
  163. ._search-clear {
  164. display: none;
  165. position: absolute;
  166. top: .5em;
  167. right: 0;
  168. width: 2rem;
  169. height: 2rem;
  170. opacity: .3;
  171. @extend %hide-text;
  172. &:hover { opacity: .5; }
  173. &:before {
  174. position: absolute;
  175. top: .5rem;
  176. left: .5rem;
  177. @extend %icon;
  178. }
  179. @if $style == 'dark' {
  180. &:before { @extend %icon-close-white; }
  181. } @else {
  182. &:before { @extend %icon-clear; }
  183. }
  184. ._search-active > & { display: block; }
  185. }
  186. ._search-tag {
  187. display: none;
  188. position: absolute;
  189. z-index: 2;
  190. top: .875rem;
  191. left: .875rem;
  192. padding: 0 .5rem;
  193. line-height: 1.25rem;
  194. font-size: .875rem;
  195. color: $textColorLight;
  196. background: darken($headerBackground, 5%);
  197. border-radius: 2px;
  198. }