_search.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. .search-listpage-icon {
  2. font-size: 16px;
  3. color: $gray-400;
  4. }
  5. .search-listpage-clear {
  6. position: absolute;
  7. right: 8px;
  8. display: none;
  9. width: 22px;
  10. height: 22px;
  11. padding: 8px;
  12. font-size: 0.6em;
  13. color: $gray-300;
  14. }
  15. .search-typeahead {
  16. position: relative;
  17. width: 100%;
  18. .search-clear {
  19. position: absolute;
  20. top: 5px;
  21. right: 4px;
  22. z-index: 3;
  23. width: 24px;
  24. height: 24px;
  25. padding: 0;
  26. color: $gray-400;
  27. }
  28. .rbt-menu {
  29. max-height: none !important;
  30. margin-top: 3px;
  31. li a span {
  32. .page-path {
  33. display: inline;
  34. padding: 0 4px;
  35. color: inherit;
  36. }
  37. .page-list-meta {
  38. font-size: 0.9em;
  39. color: $gray-400;
  40. > span {
  41. margin-right: 0.3rem;
  42. }
  43. }
  44. }
  45. }
  46. }
  47. // input styles
  48. .grw-global-search {
  49. .search-clear {
  50. top: 3px;
  51. right: 26px;
  52. }
  53. .dropdown-toggle {
  54. min-width: 95px;
  55. padding-left: 1.5rem;
  56. border-top-left-radius: 40px;
  57. border-bottom-left-radius: 40px;
  58. }
  59. .search-typeahead {
  60. // corner radius
  61. border-top-right-radius: 40px;
  62. border-bottom-right-radius: 40px;
  63. .rbt-input-main {
  64. padding-right: 58px;
  65. // corner radius
  66. border-top-right-radius: 40px;
  67. border-bottom-right-radius: 40px;
  68. }
  69. .rbt-menu {
  70. @extend .dropdown-menu-right;
  71. @extend .dropdown-menu-md-left;
  72. @include media-breakpoint-down(sm) {
  73. left: auto !important;
  74. width: 90vw;
  75. }
  76. }
  77. }
  78. // using react-bootstrap-typeahead
  79. // see: https://github.com/ericgio/react-bootstrap-typeahead
  80. .rbt-input.form-control {
  81. height: 30px;
  82. .rbt-input-wrapper {
  83. margin-left: 8px;
  84. }
  85. }
  86. .form-group:not(.has-error) {
  87. .rbt-input.form-control {
  88. border: none;
  89. }
  90. }
  91. .btn-group-submit-search {
  92. position: absolute;
  93. top: 0;
  94. right: 0;
  95. z-index: 3;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. width: 32px;
  100. height: 32px;
  101. }
  102. }
  103. // layout
  104. .grw-global-search-top {
  105. // centering on navbar
  106. top: $grw-navbar-height / 2;
  107. left: 50vw;
  108. z-index: $zindex-fixed + 1;
  109. transform: translate(-50%, -50%);
  110. .rbt-input.form-control {
  111. width: 200px;
  112. transition: 0.3s ease-out;
  113. // focus
  114. &.focus {
  115. width: 300px;
  116. }
  117. @include media-breakpoint-up(md) {
  118. width: 300px;
  119. }
  120. @include media-breakpoint-up(lg) {
  121. // focus
  122. &.focus {
  123. width: 400px;
  124. }
  125. }
  126. @include media-breakpoint-up(xl) {
  127. width: 350px;
  128. // focus
  129. &.focus {
  130. width: 450px;
  131. }
  132. }
  133. }
  134. .search-typeahead {
  135. border-radius: 0 25px 25px 0;
  136. }
  137. }
  138. .search-result {
  139. .search-result-list {
  140. position: sticky;
  141. top: 64px;
  142. height: 100vh;
  143. overflow-y: scroll;
  144. .nav.nav-pills {
  145. > .page-list-li {
  146. > a {
  147. height: 123px;
  148. padding: 2px 4px;
  149. word-break: break-all;
  150. border-radius: 0;
  151. &:hover {
  152. color: inherit;
  153. text-decoration: none;
  154. }
  155. &.active {
  156. padding-right: 5px;
  157. border-left: solid 3px transparent;
  158. }
  159. > * {
  160. margin-right: 3px;
  161. }
  162. }
  163. }
  164. }
  165. .search-result-meta {
  166. margin-bottom: 10px;
  167. font-weight: bold;
  168. }
  169. .search-result-list-delete-checkbox {
  170. margin: 0 10px 0 0;
  171. vertical-align: middle;
  172. }
  173. }
  174. .search-result-content {
  175. padding-bottom: 36px;
  176. .search-result-page {
  177. padding-top: 64px;
  178. // adjust for anchor links by the height of fixed .search-page-input
  179. margin-top: -64px;
  180. > h2 {
  181. margin-right: 10px;
  182. font-size: 22px;
  183. line-height: 1em;
  184. }
  185. &:first-child > h2 {
  186. margin-top: 0;
  187. }
  188. .wiki {
  189. padding: 16px;
  190. font-size: 13px;
  191. border: solid 1px $gray-300;
  192. }
  193. }
  194. }
  195. }
  196. // 2021/9/22 TODO: Remove after moving to SearchResult
  197. .search-page-input {
  198. position: sticky;
  199. top: 15px;
  200. // placed at front-most
  201. z-index: 15;
  202. margin-bottom: 15px;
  203. .input-group-btn .btn {
  204. height: 34px;
  205. padding: 0px 10px;
  206. }
  207. }
  208. // support for your search
  209. .grw-search-table {
  210. caption {
  211. display: table-header-group;
  212. }
  213. }
  214. .search-page-item {
  215. height: 130px;
  216. }
  217. @include media-breakpoint-down(sm) {
  218. .grw-search-table {
  219. th {
  220. text-align: right;
  221. }
  222. td {
  223. overflow-wrap: anywhere;
  224. white-space: normal !important;
  225. }
  226. @include media-breakpoint-down(xs) {
  227. th,
  228. td {
  229. display: block;
  230. }
  231. th {
  232. text-align: left;
  233. }
  234. td {
  235. padding-top: 0 !important;
  236. border-top: none !important;
  237. }
  238. }
  239. }
  240. }