_search.scss 4.5 KB

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