_search.scss 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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. &-result {
  63. position: absolute;
  64. width: 100%;
  65. height: calc(100% - 8px);
  66. z-index: z('navbar');
  67. margin: 4px 0;
  68. @include themify($themes) {
  69. background-color: themed('body-background-color');
  70. }
  71. &[data-display="block"] {
  72. display: block;
  73. }
  74. &[data-display="none"] {
  75. display: none;
  76. }
  77. &__header {
  78. }
  79. &__close {
  80. position: absolute;
  81. right: 0.25rem;
  82. top: 0.25rem;
  83. cursor: pointer;
  84. @include themify($themes) {
  85. color: themed('body-color');
  86. @include on-event {
  87. color: themed('active-font-color');
  88. }
  89. }
  90. }
  91. &__body {
  92. margin-top: 2.25rem;
  93. padding: 0 1rem;
  94. position: relative;
  95. display: block;
  96. overflow: auto;
  97. height: calc(100% - 3rem);
  98. @include themify($themes) {
  99. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  100. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  101. }
  102. }
  103. &__item {
  104. padding: 1rem 0;
  105. @include themify($themes) {
  106. border-bottom: 2px dashed themed('hr-color');
  107. &--title {
  108. font-family: $title-font;
  109. font-size: 1rem;
  110. margin: 0.25rem 0;
  111. color: themed('title-color');
  112. &::before {
  113. content: "📋 ";
  114. }
  115. }
  116. &--desc {
  117. font-size: 0.9rem;
  118. margin: 0.25rem 0;
  119. color: themed('body-color');
  120. }
  121. }
  122. }
  123. }
  124. }
  125. .menu-item {
  126. padding: 0.25rem;
  127. &__title {
  128. font-size: 1rem;
  129. @include themify($themes) {
  130. color: themed('body-color');
  131. }
  132. }
  133. &__desc {
  134. font-size: 0.8rem;
  135. padding: 0.25rem 0.5rem;
  136. @include truncate(325px);
  137. @include themify($themes) {
  138. color: themed('search-color');
  139. }
  140. }
  141. }
  142. #search-results {
  143. &.dd {
  144. display: none;
  145. z-index: z('navbar');
  146. &.is-active {
  147. display: inline-block;
  148. position: absolute;
  149. top: 40px;
  150. right: 0;
  151. width: 325px;
  152. border-radius: .175rem;
  153. @include box-shadow(0, 1px, 3px, 0, rgba(0, 0, 0, 0.4));
  154. @include themify($themes) {
  155. background-color: themed('back-background-color');
  156. }
  157. }
  158. }
  159. .dd {
  160. &-content {
  161. @include flexbox();
  162. @include flex-direction(column);
  163. @include themify($themes) {
  164. background-color: themed('search-content-background-color');
  165. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  166. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  167. }
  168. }
  169. &-item {
  170. width: 100%;
  171. font-size: 1rem;
  172. padding: 0.35rem 0.6rem;
  173. @include on-event {
  174. @include themify($themes) {
  175. background-color: themed('search-hover-background-color');
  176. }
  177. border-bottom-left-radius: 0.1rem;
  178. border-bottom-right-radius: 0.1rem;
  179. }
  180. &.is-active {
  181. @include themify($themes) {
  182. background-color: themed('search-hover-background-color');
  183. }
  184. }
  185. }
  186. }
  187. }
  188. .mobile-search {
  189. position: absolute;
  190. left: 0;
  191. top: 0;
  192. width: 100%;
  193. z-index: z('modal');
  194. overflow: hidden;
  195. @include themify($themes) {
  196. @include webkit-scrollbars2(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  197. }
  198. &__top {
  199. width: 100%;
  200. text-align: right;
  201. position: relative;
  202. height: $grid-nav-height;
  203. @include flexbox();
  204. @include align-items(center);
  205. @include themify($themes) {
  206. background-color: themed('navbar-background-color');
  207. }
  208. &--icon {
  209. width: 50px;
  210. cursor: pointer;
  211. position: absolute;
  212. right: 0;
  213. @include flexbox();
  214. @include align-items(center);
  215. @include justify-content(center);
  216. @include themify($themes) {
  217. color: themed('burger-menu-color');
  218. @include on-event {
  219. color: themed('active-font-color');
  220. }
  221. }
  222. }
  223. &--input {
  224. width: calc(100% - 70px);
  225. height: 70%;
  226. outline: none;
  227. border: none;
  228. border-radius: 0.25rem;
  229. padding: 0 1rem;
  230. font-size: 1.1rem;
  231. @include themify($themes) {
  232. color: themed('body-color');
  233. background-color: themed('navbar-background-color');
  234. @include input-placeholder {
  235. color: themed("search-placeholder-color");
  236. }
  237. }
  238. }
  239. }
  240. &__body {
  241. width: 100%;
  242. height: calc(100vh - $grid-nav-height);
  243. overflow: auto;
  244. @include themify($themes) {
  245. color: themed('body-color');
  246. background-color: themed('body-background-color');
  247. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  248. }
  249. }
  250. &__btn {
  251. width: 100%;
  252. z-index: z('search-btn');
  253. background-color: transparent;
  254. @include flexbox();
  255. @include align-items(center);
  256. @include justify-content(center);
  257. @include themify($themes) {
  258. color: themed('burger-menu-color');
  259. @include on-event {
  260. color: themed('active-font-color');
  261. }
  262. }
  263. }
  264. &__content {
  265. @include themify($themes) {
  266. background-color: themed('search-content-background-color');
  267. }
  268. a {
  269. text-decoration: none !important;
  270. }
  271. }
  272. &__item {
  273. padding: 0.5rem;
  274. list-style-type: none;
  275. &--title {
  276. font-size: 1.2rem;
  277. @include themify($themes) {
  278. color: themed('body-color');
  279. }
  280. &::before {
  281. content: "📋 ";
  282. }
  283. }
  284. &--desc {
  285. font-size: 0.9rem;
  286. padding: 0.25rem 0.5rem;
  287. @include themify($themes) {
  288. color: themed('search-color');
  289. }
  290. }
  291. @include on-event {
  292. @include themify($themes) {
  293. background-color: themed('search-hover-background-color');
  294. }
  295. }
  296. }
  297. }