|
15 | 15 | --ifm-color-primary-lightest: #4169c4; |
16 | 16 | --ifm-code-font-size: 95%; |
17 | 17 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); |
18 | | - --ifm-font-family-base: |
19 | | - 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; |
| 18 | + --ifm-font-family-base: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; |
20 | 19 | } |
21 | 20 |
|
22 | 21 | /* For readability concerns, you should choose a lighter palette in dark mode. */ |
@@ -207,3 +206,145 @@ html { |
207 | 206 | [data-theme='dark'] img { |
208 | 207 | border-color: #3a3a3a; |
209 | 208 | } |
| 209 | + |
| 210 | +/* Add this to your /src/css/custom.css file */ |
| 211 | + |
| 212 | +/* Algolia DocSearch Custom Styling */ |
| 213 | +/* Using CSS variables for better theme integration */ |
| 214 | + |
| 215 | +[data-theme='light'] .DocSearch { |
| 216 | + --docsearch-primary-color: var(--ifm-color-primary); |
| 217 | + --docsearch-text-color: var(--ifm-font-color-base); |
| 218 | + --docsearch-muted-color: var(--ifm-color-secondary-darkest); |
| 219 | + --docsearch-container-background: rgba(94, 100, 112, 0.7); |
| 220 | + |
| 221 | + /* Modal */ |
| 222 | + --docsearch-modal-background: var(--ifm-color-secondary-lighter); |
| 223 | + |
| 224 | + /* Search box */ |
| 225 | + --docsearch-searchbox-background: var(--ifm-color-secondary); |
| 226 | + --docsearch-searchbox-focus-background: var(--ifm-color-white); |
| 227 | + |
| 228 | + /* Hit */ |
| 229 | + --docsearch-hit-color: var(--ifm-font-color-base); |
| 230 | + --docsearch-hit-active-color: var(--ifm-color-white); |
| 231 | + --docsearch-hit-background: var(--ifm-color-white); |
| 232 | + |
| 233 | + /* Footer */ |
| 234 | + --docsearch-footer-background: var(--ifm-color-white); |
| 235 | +} |
| 236 | + |
| 237 | +[data-theme='dark'] .DocSearch { |
| 238 | + --docsearch-text-color: var(--ifm-font-color-base); |
| 239 | + --docsearch-muted-color: var(--ifm-color-secondary-darkest); |
| 240 | + --docsearch-container-background: rgba(47, 55, 69, 0.7); |
| 241 | + |
| 242 | + /* Modal */ |
| 243 | + --docsearch-modal-background: var(--ifm-background-color); |
| 244 | + |
| 245 | + /* Search box */ |
| 246 | + --docsearch-searchbox-background: var(--ifm-background-color); |
| 247 | + --docsearch-searchbox-focus-background: var(--ifm-color-black); |
| 248 | + |
| 249 | + /* Hit */ |
| 250 | + --docsearch-hit-color: var(--ifm-font-color-base); |
| 251 | + --docsearch-hit-active-color: var(--ifm-color-white); |
| 252 | + --docsearch-hit-background: var(--ifm-color-emphasis-100); |
| 253 | + |
| 254 | + /* Footer */ |
| 255 | + --docsearch-footer-background: var(--ifm-background-surface-color); |
| 256 | + --docsearch-key-gradient: linear-gradient(-26.5deg, var(--ifm-color-emphasis-200) 0%, var(--ifm-color-emphasis-100) 100%); |
| 257 | +} |
| 258 | + |
| 259 | +/* Custom enhancements for better UX */ |
| 260 | +.DocSearch-Button { |
| 261 | + /* Make the search button more prominent */ |
| 262 | + margin: 0 12px; |
| 263 | + padding: 0 16px; |
| 264 | + font-weight: 500; |
| 265 | +} |
| 266 | + |
| 267 | +/* Highlight product and version info in search results */ |
| 268 | +.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-hierarchy { |
| 269 | + font-weight: 600; |
| 270 | +} |
| 271 | + |
| 272 | +/* Style the product > version breadcrumb in results */ |
| 273 | +.DocSearch-Hit-hierarchy .DocSearch-Hit-lvl0 { |
| 274 | + color: var(--docsearch-primary-color); |
| 275 | + font-weight: 600; |
| 276 | +} |
| 277 | + |
| 278 | +/* Add visual separation for different product sections */ |
| 279 | +.DocSearch-Hits ul { |
| 280 | + margin: 0; |
| 281 | +} |
| 282 | + |
| 283 | +/* Improve readability of search snippets */ |
| 284 | +.DocSearch-Hit-content { |
| 285 | + line-height: 1.5; |
| 286 | + font-size: 0.875rem; |
| 287 | +} |
| 288 | + |
| 289 | +/* Highlight search terms more prominently */ |
| 290 | +.DocSearch-Hit-content mark { |
| 291 | + background-color: var(--ifm-color-primary-lighter); |
| 292 | + color: var(--ifm-font-color-base); |
| 293 | + font-weight: 600; |
| 294 | + padding: 0 2px; |
| 295 | +} |
| 296 | + |
| 297 | +/* Add product/version badges if needed */ |
| 298 | +.DocSearch-Hit-content-wrapper { |
| 299 | + position: relative; |
| 300 | +} |
| 301 | + |
| 302 | +/* Responsive improvements */ |
| 303 | +@media (max-width: 768px) { |
| 304 | + .DocSearch-Button-Keys { |
| 305 | + display: none; |
| 306 | + } |
| 307 | + |
| 308 | + .DocSearch-Button { |
| 309 | + padding: 0 12px; |
| 310 | + } |
| 311 | +} |
| 312 | + |
| 313 | +/* Optional: Add custom icons for different content types */ |
| 314 | +.DocSearch-Hit-icon { |
| 315 | + color: var(--docsearch-muted-color); |
| 316 | +} |
| 317 | + |
| 318 | +/* Style the search page if you're using searchPagePath */ |
| 319 | +.search-page { |
| 320 | + min-height: 70vh; |
| 321 | + padding: 2rem; |
| 322 | +} |
| 323 | + |
| 324 | +.search-page .DocSearch-Container { |
| 325 | + position: relative; |
| 326 | + background: transparent; |
| 327 | +} |
| 328 | + |
| 329 | +/* Add smooth transitions */ |
| 330 | +.DocSearch-Hit { |
| 331 | + transition: background-color 0.2s ease; |
| 332 | +} |
| 333 | + |
| 334 | +/* Custom scrollbar for search results */ |
| 335 | +.DocSearch-Dropdown::-webkit-scrollbar { |
| 336 | + width: 12px; |
| 337 | +} |
| 338 | + |
| 339 | +.DocSearch-Dropdown::-webkit-scrollbar-track { |
| 340 | + background: var(--docsearch-modal-background); |
| 341 | +} |
| 342 | + |
| 343 | +.DocSearch-Dropdown::-webkit-scrollbar-thumb { |
| 344 | + background: var(--docsearch-muted-color); |
| 345 | + border-radius: 6px; |
| 346 | +} |
| 347 | + |
| 348 | +.DocSearch-Dropdown::-webkit-scrollbar-thumb:hover { |
| 349 | + background: var(--docsearch-primary-color); |
| 350 | +} |
0 commit comments