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