_search.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. .search {
  2. height: 30px;
  3. width: 240px;
  4. position: relative;
  5. border-radius: 0.175rem;
  6. z-index: z('search');
  7. margin: 0 0.75rem;
  8. @include box-shadow(0, 0, 0, 3px, transparent);
  9. @include transition(all, 0.2s, ease-in);
  10. @include flexbox();
  11. @include align-items(center);
  12. @include transition(all, 0.15s, ease);
  13. @include themify($themes) {
  14. border: 2px solid themed('search-border-color');
  15. background-color: themed("search-background-color");
  16. &:focus-within {
  17. border: 2px solid themed('search-border-active-color');
  18. @include box-shadow(0, 0, 0, 3px, themed('search-border-outline-color'));
  19. }
  20. }
  21. @media only screen and (max-width: 1280px) {
  22. width: 170px;
  23. }
  24. @media only screen and (max-width: 960px) {
  25. display: none;
  26. }
  27. .icon {
  28. padding: 0.45rem;
  29. @include flexbox();
  30. @include themify($themes) {
  31. color: themed("search-placeholder-color");
  32. }
  33. }
  34. .input {
  35. width: 100%;
  36. font-size: 0.9rem;
  37. border: none;
  38. outline: none;
  39. padding-right: 1rem;
  40. @include themify($themes) {
  41. color: themed('body-color');
  42. background-color: inherit;
  43. @include input-placeholder {
  44. color: themed("search-placeholder-color");
  45. }
  46. }
  47. }
  48. &-content {
  49. margin-top: 0.25rem;
  50. max-height: 350px;
  51. width: 325px;
  52. overflow: auto;
  53. a {
  54. text-decoration: none !important;
  55. }
  56. }
  57. &__highlight {
  58. @include themify($themes) {
  59. color: themed('search-highlight-color');
  60. }
  61. }
  62. }
  63. .menu-item {
  64. padding: 0.25rem;
  65. &__title {
  66. font-size: 1rem;
  67. @include themify($themes) {
  68. color: themed('body-color');
  69. }
  70. }
  71. &__desc {
  72. font-size: 0.8rem;
  73. padding: 0.25rem 0.5rem;
  74. @include truncate(325px);
  75. @include themify($themes) {
  76. color: themed('search-color');
  77. }
  78. }
  79. }
  80. #search-results {
  81. &.dd {
  82. display: none;
  83. &.is-active {
  84. display: inline-block;
  85. position: absolute;
  86. top: 40px;
  87. right: 0;
  88. width: 325px;
  89. border-radius: .175rem;
  90. @include box-shadow(0, 1px, 3px, 0, rgba(0, 0, 0, 0.4));
  91. @include themify($themes) {
  92. background-color: themed('back-background-color');
  93. }
  94. }
  95. }
  96. .dd {
  97. &-content {
  98. @include flexbox();
  99. @include flex-direction(column);
  100. @include themify($themes) {
  101. background-color: themed('search-content-background-color');
  102. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  103. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  104. }
  105. }
  106. &-item {
  107. width: 100%;
  108. font-size: 1rem;
  109. padding: 0.125rem;
  110. @include on-event {
  111. @include themify($themes) {
  112. background-color: themed('search-hover-background-color');
  113. }
  114. border-bottom-left-radius: 0.1rem;
  115. border-bottom-right-radius: 0.1rem;
  116. }
  117. &.is-active {
  118. @include themify($themes) {
  119. background-color: themed('search-hover-background-color');
  120. }
  121. }
  122. }
  123. }
  124. }
  125. .mobile-search {
  126. position: absolute;
  127. left: 0;
  128. top: 0;
  129. width: 100%;
  130. z-index: z('modal');
  131. overflow: hidden;
  132. @include themify($themes) {
  133. @include webkit-scrollbars2(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  134. }
  135. &__top {
  136. width: 100%;
  137. text-align: right;
  138. position: relative;
  139. height: $grid-nav-height;
  140. @include flexbox();
  141. @include align-items(center);
  142. @include themify($themes) {
  143. background-color: themed('navbar-background-color');
  144. }
  145. &--icon {
  146. width: 50px;
  147. cursor: pointer;
  148. position: absolute;
  149. right: 0;
  150. @include flexbox();
  151. @include align-items(center);
  152. @include justify-content(center);
  153. @include themify($themes) {
  154. color: themed('burger-menu-color');
  155. @include on-event {
  156. color: themed('active-font-color');
  157. }
  158. }
  159. }
  160. &--input {
  161. width: calc(100% - 70px);
  162. height: 70%;
  163. outline: none;
  164. border: none;
  165. border-radius: 0.25rem;
  166. padding: 0 1rem;
  167. font-size: 1.1rem;
  168. @include themify($themes) {
  169. color: themed('body-color');
  170. background-color: themed('navbar-background-color');
  171. @include input-placeholder {
  172. color: themed("search-placeholder-color");
  173. }
  174. }
  175. }
  176. }
  177. &__body {
  178. width: 100%;
  179. height: calc(100vh - $grid-nav-height);
  180. overflow: auto;
  181. @include themify($themes) {
  182. color: themed('body-color');
  183. background-color: themed('body-background-color');
  184. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  185. }
  186. }
  187. &__btn {
  188. width: 100%;
  189. z-index: z('search-btn');
  190. background-color: transparent;
  191. @include flexbox();
  192. @include align-items(center);
  193. @include justify-content(center);
  194. @include themify($themes) {
  195. color: themed('burger-menu-color');
  196. @include on-event {
  197. color: themed('active-font-color');
  198. }
  199. }
  200. }
  201. &__content {
  202. @include themify($themes) {
  203. background-color: themed('search-content-background-color');
  204. }
  205. a {
  206. text-decoration: none !important;
  207. }
  208. }
  209. &__item {
  210. padding: 0.5rem;
  211. &--title {
  212. font-size: 1.2rem;
  213. @include themify($themes) {
  214. color: themed('body-color');
  215. }
  216. }
  217. &--desc {
  218. font-size: 0.9rem;
  219. padding: 0.25rem 0.5rem;
  220. @include truncate(960px);
  221. @include themify($themes) {
  222. color: themed('search-color');
  223. }
  224. }
  225. @include on-event {
  226. @include themify($themes) {
  227. background-color: themed('search-hover-background-color');
  228. }
  229. }
  230. }
  231. }