_search.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*************************************************
  2. * Search
  3. **************************************************/
  4. .search-results {
  5. transform: scale(0);
  6. -webkit-transform: scale(0);
  7. background-color: $sta-background;
  8. bottom: 0;
  9. left: 0;
  10. right: 0;
  11. top: 0;
  12. overflow: scroll;
  13. position: fixed;
  14. visibility: hidden;
  15. z-index: -99;
  16. }
  17. .dark .search-results {
  18. background-color: $sta-dark-background;
  19. }
  20. .searching {
  21. overflow: hidden;
  22. }
  23. .searching .search-results {
  24. transform: scale(1);
  25. -webkit-transform: scale(1);
  26. visibility: visible;
  27. z-index: 1031; /* Highest index, higher than navbar. */
  28. }
  29. .searching #search-box #search-query {
  30. width: 100%;
  31. }
  32. .search-results > .container {
  33. padding-top: 70px; /* Navbar height. */
  34. }
  35. @media screen and (max-width: 1200px) {
  36. .search-results > .container {
  37. padding-top: 50px; /* Navbar height. */
  38. }
  39. }
  40. .search-header {
  41. position: -webkit-sticky;
  42. position: sticky;
  43. top: 0;
  44. background-color: $sta-background;
  45. padding-top: 2rem;
  46. padding-bottom: 1rem;
  47. }
  48. .dark .search-header {
  49. background-color: $sta-dark-background;
  50. }
  51. .search-header h1 {
  52. margin: 0;
  53. line-height: 1;
  54. }
  55. .col-search-close {
  56. text-align: right;
  57. }
  58. .search-header i {
  59. font-size: 2rem;
  60. line-height: 1;
  61. }
  62. #search-box {
  63. position: relative; /* Required for search icon positioning. */
  64. margin-bottom: 0.5rem;
  65. }
  66. #search-box::before {
  67. font-family: 'Font Awesome 5 Free';
  68. font-weight: 900;
  69. content: "\f002";
  70. font-size: 1rem;
  71. opacity: 0.25;
  72. line-height: 1rem;
  73. position: absolute;
  74. left: 0.7rem;
  75. top: 0.6rem;
  76. overflow-x: hidden;
  77. }
  78. #search-box #search-query {
  79. border: 1px solid #dedede;
  80. border-radius: 1rem;
  81. padding: 1rem 1rem 1rem 2rem; /* Wider left padding for search icon to fit in. */
  82. width: 250px;
  83. line-height: 1rem;
  84. height: 1rem;
  85. font-size: 0.8rem;
  86. }
  87. .search-hit em {
  88. font-style: normal;
  89. background-color: #FFE0B2;
  90. color: #E65100;
  91. border-bottom: 1px solid #E65100;
  92. }
  93. .search-hit-type {
  94. margin-bottom: 0 !important; /* Override .article-metadata margin. */
  95. text-transform: capitalize;
  96. }
  97. .search-hit-description {
  98. font-size: 0.7rem;
  99. }
  100. /* Load more results button - hide when there are no more results. */
  101. #search-hits button[disabled] {
  102. display: none;
  103. }
  104. .form-control:focus {
  105. border-color: $sta-primary;
  106. box-shadow: 0 0 0 .2rem $sta-primary-light;
  107. }
  108. /* DARK themed components. */
  109. /* Algolia search input */
  110. .dark .ais-search-box--input {
  111. background-color: $sta-dark-background;;
  112. }
  113. .dark #search-query {
  114. background-color: $sta-dark-background;;
  115. }