_header.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // Header
  3. //
  4. ._header {
  5. position: absolute;
  6. z-index: $headerZ;
  7. top: 0;
  8. left: 0;
  9. right: 0;
  10. height: $headerHeight;
  11. line-height: $headerHeight;
  12. background: $headerBackground;
  13. border-bottom: 1px solid $headerBorder;
  14. @extend %user-select-none;
  15. a:focus { outline: 0; }
  16. }
  17. //
  18. // Navigation menu
  19. //
  20. ._nav {
  21. float: right;
  22. margin-right: .5rem;
  23. font-size: .875rem;
  24. color: $textColor;
  25. }
  26. ._nav-link,
  27. ._nav-link:hover {
  28. position: relative;
  29. float: left;
  30. padding: 0 1.25rem;
  31. color: inherit;
  32. text-decoration: none;
  33. }
  34. ._nav-link {
  35. &:before, &:after {
  36. position: absolute;
  37. left: 50%;
  38. bottom: 0;
  39. width: 0;
  40. height: 0;
  41. margin-left: -.375rem;
  42. border: .375rem solid transparent;
  43. border-bottom-color: darken($headerBorder, 2%);
  44. }
  45. &:after {
  46. bottom: -1px;
  47. border-bottom-color: $contentBackground;
  48. }
  49. }
  50. ._nav-current {
  51. &:before, &:after { content: ''; }
  52. }
  53. //
  54. // Logo
  55. //
  56. ._logo {
  57. position: relative;
  58. float: left;
  59. height: $headerHeight;
  60. margin: 0;
  61. line-height: inherit;
  62. font-size: inherit;
  63. > ._nav-link {
  64. float: none;
  65. padding: 0 1rem;
  66. }
  67. }
  68. //
  69. // Search form
  70. //
  71. ._search {
  72. position: relative;
  73. float: left;
  74. width: $sidebarWidth;
  75. height: 100%;
  76. padding: .5rem 0 .5rem .5rem;
  77. @extend %border-box;
  78. @media #{$mediumScreen} { width: $sidebarMediumWidth; }
  79. &:before {
  80. position: absolute;
  81. top: 1rem;
  82. left: 1rem;
  83. opacity: .4;
  84. @extend %icon, %icon-search;
  85. }
  86. }
  87. ._search-input {
  88. display: block;
  89. width: 100%;
  90. height: 100%;
  91. padding: 0 .75rem 1px 1.75rem;
  92. font-size: .875rem;
  93. background: $contentBackground;
  94. border: 1px solid;
  95. border-color: darken($headerBorder, 2%);
  96. border-radius: 3px;
  97. &:focus {
  98. outline: 0;
  99. border-color: $inputFocusBorder;
  100. box-shadow: 0 0 1px $inputFocusBorder;
  101. }
  102. }
  103. ._search-clear {
  104. display: none;
  105. position: absolute;
  106. top: .5em;
  107. right: 0;
  108. padding: .5em;
  109. cursor: pointer;
  110. opacity: .3;
  111. &:hover { opacity: .5; }
  112. &:before { @extend %icon, %icon-clear; }
  113. ._search-active > & { display: block; }
  114. }
  115. ._search-tag {
  116. display: none;
  117. position: absolute;
  118. top: .875rem;
  119. left: .875rem;
  120. padding: 0 .5rem;
  121. line-height: 1.25rem;
  122. font-size: .875rem;
  123. color: $textColorLight;
  124. background: darken($headerBackground, 5%);
  125. border-radius: 2px;
  126. }