_search.scss 7.9 KB

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