docsearch.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. /*! @docsearch/css 3.1.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */
  2. :root {
  3. --docsearch-primary-color: red;
  4. --docsearch-highlight-color: var(--docsearch-primary-color);
  5. --docsearch-muted-color: theme('colors.slate.500');
  6. --docsearch-emphasis-color: theme('colors.slate.900');
  7. --docsearch-logo-color: #5468ff;
  8. --docsearch-modal-width: 35rem;
  9. --docsearch-modal-height: 37.5rem;
  10. --docsearch-modal-background: theme('colors.white');
  11. --docsearch-modal-shadow: theme('boxShadow.xl');
  12. --docsearch-searchbox-height: 3rem;
  13. --docsearch-hit-color: theme('colors.slate.700');
  14. --docsearch-hit-active-color: theme('colors.sky.600');
  15. --docsearch-hit-active-background: theme('colors.slate.100');
  16. --docsearch-footer-height: 3rem;
  17. --docsearch-border-color: theme('colors.slate.200');
  18. --docsearch-input-color: theme('colors.slate.900');
  19. --docsearch-heading-color: theme('colors.slate.900');
  20. --docsearch-key-background: theme('colors.slate.100');
  21. --docsearch-key-hover-background: theme('colors.slate.200');
  22. --docsearch-key-color: theme('colors.slate.500');
  23. --docsearch-action-color: theme('colors.slate.400');
  24. --docsearch-action-active-background: theme('colors.slate.200');
  25. --docsearch-loading-background: theme('colors.slate.400');
  26. --docsearch-loading-foreground: theme('colors.slate.900');
  27. }
  28. .dark {
  29. --docsearch-highlight-color: var(--docsearch-primary-color);
  30. --docsearch-muted-color: theme('colors.slate.400');
  31. --docsearch-emphasis-color: theme('colors.white');
  32. --docsearch-logo-color: theme('colors.slate.300');
  33. --docsearch-modal-background: theme('colors.slate.800');
  34. --docsearch-modal-shadow: 0 0 0 1px theme('colors.slate.700'),
  35. theme('boxShadow.xl');
  36. --docsearch-hit-color: theme('colors.slate.300');
  37. --docsearch-hit-active-color: theme('colors.sky.400');
  38. --docsearch-hit-active-background: rgb(51 65 85 / 0.3);
  39. --docsearch-border-color: rgb(148 163 184 / 0.1);
  40. --docsearch-heading-color: theme('colors.white');
  41. --docsearch-key-background: rgb(51 65 85 / 0.4);
  42. --docsearch-key-hover-background: rgb(51 65 85 / 0.8);
  43. --docsearch-key-color: theme('colors.slate.400');
  44. --docsearch-input-color: theme('colors.white');
  45. --docsearch-action-color: theme('colors.slate.500');
  46. --docsearch-action-active-background: theme('colors.slate.700');
  47. --docsearch-loading-background: theme('colors.slate.500');
  48. --docsearch-loading-foreground: theme('colors.white');
  49. }
  50. .DocSearch--active {
  51. overflow: hidden !important;
  52. }
  53. .DocSearch-Container {
  54. position: fixed;
  55. z-index: 200;
  56. top: 0;
  57. left: 0;
  58. width: 100vw;
  59. height: 100vh;
  60. height: -webkit-fill-available;
  61. height: calc(var(--docsearch-vh, 1vh) * 100);
  62. background-color: rgb(15 23 42 / 0.5);
  63. backdrop-filter: blur(theme('backdropBlur.DEFAULT'));
  64. cursor: auto;
  65. }
  66. .DocSearch-Link {
  67. appearance: none;
  68. background: none;
  69. border: 0;
  70. color: var(--docsearch-highlight-color);
  71. cursor: pointer;
  72. font: inherit;
  73. }
  74. .DocSearch-Modal {
  75. position: relative;
  76. overflow: hidden;
  77. width: 100%;
  78. max-width: 100%;
  79. height: 100vh;
  80. height: -webkit-fill-available;
  81. height: calc(var(--docsearch-vh, 1vh) * 100);
  82. background: var(--docsearch-modal-background);
  83. }
  84. .DocSearch-SearchBar {
  85. display: flex;
  86. height: var(--docsearch-searchbox-height);
  87. border-bottom: 1px solid var(--docsearch-border-color);
  88. }
  89. .DocSearch-Form {
  90. position: relative;
  91. width: 100%;
  92. display: flex;
  93. }
  94. .DocSearch-Input {
  95. appearance: none;
  96. color: var(--docsearch-input-color);
  97. flex: 1;
  98. font-size: 1rem;
  99. background: transparent;
  100. padding: 0 1rem 0 3rem;
  101. outline: none;
  102. }
  103. .DocSearch-Input::placeholder {
  104. color: theme('colors.slate.400');
  105. opacity: 1;
  106. }
  107. .DocSearch-Input::-webkit-search-cancel-button,
  108. .DocSearch-Input::-webkit-search-decoration,
  109. .DocSearch-Input::-webkit-search-results-button,
  110. .DocSearch-Input::-webkit-search-results-decoration {
  111. display: none;
  112. }
  113. .DocSearch-Reset {
  114. display: none;
  115. }
  116. .DocSearch-Container--Stalled .DocSearch-MagnifierLabel,
  117. .DocSearch-LoadingIndicator {
  118. display: none;
  119. }
  120. .DocSearch-Container--Stalled .DocSearch-LoadingIndicator {
  121. position: absolute;
  122. top: 0.875rem;
  123. left: 1rem;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. width: 1.25rem;
  128. height: 1.25rem;
  129. pointer-events: none;
  130. }
  131. .DocSearch-LoadingIndicator svg {
  132. height: 1rem;
  133. width: 1rem;
  134. overflow: visible;
  135. }
  136. .DocSearch-LoadingIndicator path,
  137. .DocSearch-LoadingIndicator circle {
  138. vector-effect: non-scaling-stroke;
  139. }
  140. .DocSearch-LoadingIndicator circle {
  141. stroke: var(--docsearch-loading-background);
  142. stroke-opacity: 1;
  143. }
  144. .DocSearch-LoadingIndicator path {
  145. stroke: var(--docsearch-loading-foreground);
  146. stroke-opacity: 1;
  147. }
  148. .DocSearch-MagnifierLabel {
  149. position: absolute;
  150. top: 0.875rem;
  151. left: 1rem;
  152. pointer-events: none;
  153. width: 1.25rem;
  154. height: 1.25rem;
  155. background: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.293 17.707a1 1 0 0 0 1.414-1.414l-1.414 1.414ZM9 14a5 5 0 0 1-5-5H2a7 7 0 0 0 7 7v-2ZM4 9a5 5 0 0 1 5-5V2a7 7 0 0 0-7 7h2Zm5-5a5 5 0 0 1 5 5h2a7 7 0 0 0-7-7v2Zm8.707 12.293-3.757-3.757-1.414 1.414 3.757 3.757 1.414-1.414ZM14 9a4.98 4.98 0 0 1-1.464 3.536l1.414 1.414A6.98 6.98 0 0 0 16 9h-2Zm-1.464 3.536A4.98 4.98 0 0 1 9 14v2a6.98 6.98 0 0 0 4.95-2.05l-1.414-1.414Z' fill='%2394A3B8'/%3E%3C/svg%3E");
  156. }
  157. .dark .DocSearch-MagnifierLabel {
  158. background: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.293 17.707a1 1 0 0 0 1.414-1.414l-1.414 1.414ZM9 14a5 5 0 0 1-5-5H2a7 7 0 0 0 7 7v-2ZM4 9a5 5 0 0 1 5-5V2a7 7 0 0 0-7 7h2Zm5-5a5 5 0 0 1 5 5h2a7 7 0 0 0-7-7v2Zm8.707 12.293-3.757-3.757-1.414 1.414 3.757 3.757 1.414-1.414ZM14 9a4.98 4.98 0 0 1-1.464 3.536l1.414 1.414A6.98 6.98 0 0 0 16 9h-2Zm-1.464 3.536A4.98 4.98 0 0 1 9 14v2a6.98 6.98 0 0 0 4.95-2.05l-1.414-1.414Z' fill='%2364748b'/%3E%3C/svg%3E");
  159. }
  160. .DocSearch-MagnifierLabel svg {
  161. display: none;
  162. }
  163. .DocSearch-Dropdown {
  164. height: 100%;
  165. max-height: calc(
  166. var(--docsearch-vh, 1vh) * 100 - var(--docsearch-searchbox-height) -
  167. var(--docsearch-footer-height)
  168. );
  169. overflow-y: auto;
  170. overflow-y: overlay;
  171. padding: 1rem 0.5rem;
  172. scrollbar-color: var(--docsearch-muted-color)
  173. var(--docsearch-modal-background);
  174. scrollbar-width: thin;
  175. }
  176. .DocSearch-Dropdown::-webkit-scrollbar {
  177. width: 12px;
  178. }
  179. .DocSearch-Dropdown::-webkit-scrollbar-track {
  180. background: transparent;
  181. }
  182. .DocSearch-Dropdown::-webkit-scrollbar-thumb {
  183. background-color: var(--docsearch-muted-color);
  184. border: 3px solid var(--docsearch-modal-background);
  185. border-radius: 20px;
  186. }
  187. .DocSearch-StartScreen {
  188. padding: 2rem 1rem;
  189. text-align: center;
  190. }
  191. .DocSearch-Label {
  192. font-size: 0.75rem;
  193. line-height: 1rem;
  194. }
  195. .DocSearch-Help,
  196. .DocSearch-Label {
  197. color: var(--docsearch-muted-color);
  198. }
  199. .DocSearch-Help {
  200. font-size: 0.875rem;
  201. }
  202. .DocSearch-Title {
  203. font-size: 0.875rem;
  204. color: var(--docsearch-muted-color);
  205. }
  206. .DocSearch-Title strong {
  207. color: var(--docsearch-emphasis-color);
  208. font-weight: inherit;
  209. }
  210. .DocSearch-Logo a {
  211. display: flex;
  212. align-items: center;
  213. }
  214. .DocSearch-Logo svg {
  215. color: var(--docsearch-logo-color);
  216. margin-left: 0.5rem;
  217. }
  218. .DocSearch-Hits + .DocSearch-Hits {
  219. margin-top: 1.5rem;
  220. }
  221. .DocSearch-Hits mark {
  222. background: none;
  223. color: var(--docsearch-hit-active-color);
  224. }
  225. .DocSearch-HitsFooter {
  226. display: none;
  227. }
  228. .DocSearch-Hit {
  229. display: flex;
  230. position: relative;
  231. }
  232. .DocSearch-Hit--deleting,
  233. .DocSearch-Hit--favoriting {
  234. transform: scale(1);
  235. transition: all 0.0001s linear;
  236. }
  237. .DocSearch-Hit a {
  238. display: block;
  239. width: 100%;
  240. border-radius: theme('borderRadius.lg');
  241. }
  242. .DocSearch-Hit-source,
  243. .DocSearch-NoResults .DocSearch-Help {
  244. margin-left: 0.75rem;
  245. margin-bottom: 0.5rem;
  246. font-family: theme('fontFamily.display');
  247. color: var(--docsearch-heading-color);
  248. font-size: 0.875rem;
  249. font-weight: 500;
  250. line-height: 1.5rem;
  251. }
  252. .DocSearch-Hit-Tree {
  253. width: 0.5rem;
  254. }
  255. .DocSearch-Hit-Tree * {
  256. display: none;
  257. }
  258. .DocSearch-Hit[aria-selected='true'] a,
  259. .DocSearch-Prefill:hover,
  260. .DocSearch-Prefill:focus {
  261. background-color: var(--docsearch-hit-active-background);
  262. outline: none;
  263. }
  264. .DocSearch-Hit[aria-selected='true'] mark {
  265. text-decoration: underline;
  266. }
  267. .DocSearch-Hit-Container,
  268. .DocSearch-Prefill {
  269. display: flex;
  270. align-items: center;
  271. padding: 0.5rem 0.75rem;
  272. color: var(--docsearch-hit-color);
  273. }
  274. .DocSearch-Hit-icon {
  275. display: none;
  276. }
  277. .DocSearch-Hit-action {
  278. color: var(--docsearch-action-color);
  279. stroke-width: 2;
  280. }
  281. .DocSearch-Hit-action + .DocSearch-Hit-action {
  282. margin-left: 0.375rem;
  283. }
  284. .DocSearch-Hit-action-button {
  285. border-radius: 50%;
  286. color: inherit;
  287. height: 1.5rem;
  288. width: 1.5rem;
  289. display: flex;
  290. align-items: center;
  291. justify-content: center;
  292. }
  293. .DocSearch-Hit-action svg {
  294. height: 1.125rem;
  295. width: 1.125rem;
  296. }
  297. svg.DocSearch-Hit-Select-Icon {
  298. display: none;
  299. }
  300. .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Select-Icon {
  301. display: block;
  302. }
  303. .DocSearch-Hit-action-button:focus,
  304. .DocSearch-Hit-action-button:hover {
  305. background: var(--docsearch-action-active-background);
  306. }
  307. .DocSearch-Hit-content-wrapper {
  308. position: relative;
  309. flex: 1 1 auto;
  310. display: flex;
  311. flex-direction: column;
  312. justify-content: center;
  313. overflow-x: hidden;
  314. text-overflow: ellipsis;
  315. white-space: nowrap;
  316. width: 80%;
  317. }
  318. .DocSearch-Hit-title,
  319. .DocSearch-Prefill {
  320. font-size: 0.875rem;
  321. line-height: 1.5rem;
  322. }
  323. .DocSearch-Hit-path {
  324. color: var(--docsearch-muted-color);
  325. font-size: 0.75rem;
  326. line-height: 1rem;
  327. }
  328. .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-path,
  329. .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-text,
  330. .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-title,
  331. .DocSearch-Hit[aria-selected='true'] mark,
  332. .DocSearch-Prefill:hover,
  333. .DocSearch-Prefill:focus {
  334. color: var(--docsearch-hit-active-color);
  335. }
  336. .DocSearch-NoResults .DocSearch-Screen-Icon {
  337. display: none;
  338. }
  339. .DocSearch-NoResults .DocSearch-Title {
  340. text-align: center;
  341. padding: 2rem 1rem 3rem;
  342. }
  343. .DocSearch-NoResults-Prefill-List {
  344. margin: 0 -0.5rem;
  345. padding: 1rem 0.5rem 0;
  346. border-top: 1px solid var(--docsearch-border-color);
  347. }
  348. .DocSearch-Prefill {
  349. width: 100%;
  350. border-radius: theme('borderRadius.lg');
  351. }
  352. .DocSearch-Footer {
  353. position: absolute;
  354. bottom: 0;
  355. display: flex;
  356. flex-direction: row-reverse;
  357. align-items: center;
  358. justify-content: space-between;
  359. flex-shrink: 0;
  360. width: 100%;
  361. height: var(--docsearch-footer-height);
  362. z-index: 300;
  363. border-top: 1px solid var(--docsearch-border-color);
  364. padding: 0 1rem;
  365. }
  366. .DocSearch-Commands {
  367. display: none;
  368. }
  369. .DocSearch-Cancel {
  370. background: var(--docsearch-key-background);
  371. color: var(--docsearch-key-color);
  372. align-self: center;
  373. flex: none;
  374. font-size: 0.75rem;
  375. user-select: none;
  376. border-radius: theme('borderRadius.md');
  377. padding: 0 0.375rem;
  378. height: 1.5rem;
  379. margin-right: 1rem;
  380. }
  381. .DocSearch-Cancel:hover {
  382. background: var(--docsearch-key-hover-background);
  383. }
  384. @screen sm {
  385. .DocSearch-Container {
  386. height: 100vh;
  387. }
  388. .DocSearch-Modal {
  389. height: auto;
  390. border-radius: theme('borderRadius.xl');
  391. box-shadow: var(--docsearch-modal-shadow);
  392. margin: 4rem auto auto;
  393. width: auto;
  394. max-width: var(--docsearch-modal-width);
  395. }
  396. .DocSearch-Input {
  397. font-size: 0.875rem;
  398. }
  399. .DocSearch-Footer {
  400. position: static;
  401. }
  402. .DocSearch-Commands {
  403. display: flex;
  404. }
  405. .DocSearch-Commands li {
  406. align-items: center;
  407. display: flex;
  408. }
  409. .DocSearch-Commands li:not(:last-of-type) {
  410. margin-right: 1rem;
  411. }
  412. .DocSearch-Commands-Key {
  413. background: var(--docsearch-key-background);
  414. color: var(--docsearch-key-color);
  415. width: 1.5rem;
  416. height: 1.25rem;
  417. display: flex;
  418. align-items: center;
  419. justify-content: center;
  420. border-radius: theme('borderRadius.md');
  421. margin-right: 0.375rem;
  422. }
  423. .DocSearch-Dropdown {
  424. height: auto;
  425. max-height: calc(
  426. var(--docsearch-modal-height) - var(--docsearch-searchbox-height) -
  427. var(--docsearch-footer-height)
  428. );
  429. }
  430. }