_search.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*************************************************
  2. * Search
  3. **************************************************/
  4. // Search modal
  5. .search-modal {
  6. transform: scale(0);
  7. -webkit-transform: scale(0);
  8. background-color: $sta-background;
  9. bottom: 0;
  10. left: 0;
  11. right: 0;
  12. top: 0;
  13. overflow: scroll;
  14. position: fixed;
  15. visibility: hidden;
  16. z-index: -99;
  17. }
  18. .dark .search-modal {
  19. background-color: $sta-dark-background;
  20. }
  21. // Hide body scrollbars whilst searching in modal
  22. .searching {
  23. overflow: hidden;
  24. }
  25. .searching .search-modal {
  26. transform: scale(1);
  27. -webkit-transform: scale(1);
  28. visibility: visible;
  29. z-index: 1031; /* Highest index, higher than navbar. */
  30. }
  31. .searching #search-box #search-query {
  32. width: 100%;
  33. }
  34. .search-modal > .container {
  35. padding-top: 70px; /* Navbar height. */
  36. }
  37. @media screen and (max-width: 1200px) {
  38. .search-modal > .container {
  39. padding-top: 50px; /* Navbar height. */
  40. }
  41. }
  42. // Search modal header
  43. .search-header {
  44. position: -webkit-sticky;
  45. position: sticky;
  46. top: 0;
  47. background-color: $sta-background;
  48. padding-top: 2rem;
  49. padding-bottom: 1rem;
  50. // Reduce top padding on mobile
  51. @include media-breakpoint-down(md) {
  52. padding-top: 0;
  53. }
  54. }
  55. .dark .search-header {
  56. background-color: $sta-dark-background;
  57. }
  58. .search-header h1 {
  59. margin: 0;
  60. line-height: 1;
  61. }
  62. .col-search-close {
  63. text-align: right;
  64. }
  65. // Large icon for closing search dialog.
  66. .search-header .col-search-close i {
  67. font-size: 2rem;
  68. line-height: 1;
  69. }
  70. // Search box in modal
  71. #search-box {
  72. position: relative; /* Required for search icon positioning. */
  73. margin-bottom: 0.5rem;
  74. }
  75. #search-box::before {
  76. font-family: 'Font Awesome 5 Free';
  77. font-weight: 900;
  78. content: "\f002";
  79. font-size: 1rem;
  80. opacity: 0.25;
  81. line-height: 1rem;
  82. position: absolute;
  83. left: 0.7rem;
  84. top: 0.6rem;
  85. overflow-x: hidden;
  86. }
  87. #search-box #search-query {
  88. border: 1px solid #dedede;
  89. border-radius: 1rem;
  90. padding: 1rem 1rem 1rem 2rem; /* Wider left padding for search icon to fit in. */
  91. width: 250px;
  92. line-height: 1rem;
  93. height: 1rem;
  94. font-size: 0.8rem;
  95. }
  96. .dark #search-query {
  97. background-color: $sta-dark-background;;
  98. }
  99. .form-control:focus {
  100. border-color: $sta-primary;
  101. box-shadow: 0 0 0 .2rem $sta-primary-light;
  102. }
  103. // Search result items
  104. .search-hit em {
  105. font-style: normal;
  106. background-color: #FFE0B2;
  107. color: #E65100;
  108. border-bottom: 1px solid #E65100;
  109. }
  110. .search-hit-type {
  111. margin-bottom: 0 !important; /* Override .article-metadata margin. */
  112. text-transform: capitalize;
  113. }
  114. .search-hit-description {
  115. font-size: 0.7rem;
  116. }
  117. /* Load more results button - hide when there are no more results. */
  118. #search-hits button[disabled] {
  119. display: none;
  120. }
  121. // Search button in Book sidebar
  122. .sidebar-search {
  123. place-self: center start;
  124. display: flex;
  125. align-items: center;
  126. }
  127. .sidebar-search:hover {
  128. color: rgba(0,0,0,.8);
  129. box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
  130. }
  131. .dark .sidebar-search:hover {
  132. color: rgba(255,255,255,.8);
  133. box-shadow: inset 0 0 0 1px rgba(255,255,255,.9);
  134. }
  135. .sidebar-search-text {
  136. flex-grow: 1;
  137. text-align: left;
  138. }
  139. .sidebar-search-shortcut {
  140. font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  141. box-shadow: 0 1px 1px rgba(12,13,14,0.15), inset 0 1px 0 0 #fff;
  142. flex-shrink: 0;
  143. padding: 1px 12px;
  144. margin: 0 0 0 10px;
  145. color: rgba(0,0,0,.6);
  146. font-size: 1.2rem;
  147. letter-spacing: 1px;
  148. background: rgb(228, 230, 232);
  149. border-radius: 5px;
  150. border: 1px solid rgb(159, 166, 173);
  151. line-height: 1.2;
  152. }
  153. // Common queries
  154. #search-common-queries ul {
  155. // Empirically remove indentation due to `fa-ul`'s centered 2em spacing, wider than the search icon.
  156. margin-left: 0;
  157. padding-left: 1.6em;
  158. }
  159. #search-common-queries li {
  160. // Vertically align FA icons.
  161. line-height: 1;
  162. }
  163. #search-common-queries li a {
  164. // Color common search query links as body text.
  165. color: inherit;
  166. }
  167. .dark #search-common-queries li a {
  168. color: rgb(248, 248, 242);
  169. }
  170. // Algolia dark-themed search input
  171. .dark .ais-search-box--input {
  172. background-color: $sta-dark-background;;
  173. }