search.styl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. .search-pop-overlay {
  2. background: rgba(0, 0, 0, 0);
  3. height: 100%;
  4. left: 0;
  5. position: fixed;
  6. top: 0;
  7. transition: visibility 0s linear .2s, background .2s;
  8. visibility: hidden;
  9. width: 100%;
  10. z-index: $zindex-4;
  11. &.search-active {
  12. background: rgba(0, 0, 0, .3);
  13. transition: background .2s;
  14. visibility: visible;
  15. }
  16. }
  17. .search-popup {
  18. background: var(--card-bg-color);
  19. border-radius: 5px;
  20. height: 80%;
  21. left: calc(50% - 350px);
  22. position: fixed;
  23. top: 10%;
  24. transform: scale(0);
  25. transition: transform .2s;
  26. width: 700px;
  27. z-index: $zindex-5;
  28. .search-active & {
  29. transform: scale(1);
  30. }
  31. +mobile() {
  32. border-radius: 0;
  33. height: 100%;
  34. left: 0;
  35. margin: 0;
  36. top: 0;
  37. width: 100%;
  38. }
  39. .search-icon, .popup-btn-close {
  40. color: $grey-dark;
  41. font-size: 18px;
  42. padding: 0 10px;
  43. }
  44. .popup-btn-close {
  45. cursor: pointer;
  46. &:hover .fa {
  47. color: $black-deep;
  48. }
  49. }
  50. .search-header {
  51. background: $gainsboro;
  52. border-top-left-radius: 5px;
  53. border-top-right-radius: 5px;
  54. display: flex;
  55. padding: 5px;
  56. }
  57. input.search-input {
  58. background: transparent;
  59. border: 0;
  60. outline: 0;
  61. width: 100%;
  62. &::-webkit-search-cancel-button {
  63. display: none;
  64. }
  65. }
  66. }
  67. if (hexo-config('algolia_search.enable')) {
  68. .search-input-container {
  69. flex-grow: 1;
  70. form {
  71. padding: 2px;
  72. }
  73. }
  74. .algolia-powered {
  75. float: right;
  76. img {
  77. display: inline-block;
  78. height: 18px;
  79. vertical-align: middle;
  80. }
  81. }
  82. .algolia-results {
  83. height: calc(100% - 55px);
  84. overflow: auto;
  85. padding: 5px 30px;
  86. hr {
  87. margin: 10px 0;
  88. }
  89. }
  90. .algolia-hit-item {
  91. margin: 15px 0;
  92. }
  93. .algolia-hit-item-link {
  94. border-bottom: 1px dashed $grey-light;
  95. display: block;
  96. the-transition();
  97. }
  98. .algolia-pagination {
  99. .pagination {
  100. border-top: none;
  101. margin: 40px 0;
  102. opacity: 1;
  103. padding: 0;
  104. }
  105. .pagination-item {
  106. display: inline-block;
  107. }
  108. .page-number {
  109. border-top: 1px solid transparent;
  110. the-transition();
  111. &:hover {
  112. border-top: 1px solid $black-deep;
  113. }
  114. }
  115. .current .page-number {
  116. @extend .pagination .page-number.current;
  117. cursor: default;
  118. &:hover {
  119. border-top-color: $pagination-active-border;
  120. }
  121. }
  122. .disabled-item {
  123. visibility: hidden;
  124. }
  125. }
  126. }
  127. if (hexo-config('local_search.enable')) {
  128. .search-popup {
  129. .search-input-container {
  130. flex-grow: 1;
  131. padding: 2px;
  132. }
  133. ul.search-result-list {
  134. margin: 0 5px;
  135. padding: 0;
  136. width: 100%;
  137. }
  138. p.search-result {
  139. border-bottom: 1px dashed $grey-light;
  140. padding: 5px 0;
  141. }
  142. a.search-result-title {
  143. font-weight: bold;
  144. }
  145. .search-keyword {
  146. border-bottom: 1px dashed $red;
  147. color: $red;
  148. font-weight: bold;
  149. }
  150. #search-result {
  151. display: flex;
  152. height: calc(100% - 55px);
  153. overflow: auto;
  154. padding: 5px 25px;
  155. }
  156. #no-result {
  157. color: $grey-light;
  158. margin: auto;
  159. }
  160. }
  161. }