|
326 | 326 | } |
327 | 327 | } |
328 | 328 | } |
| 329 | + |
| 330 | +// ----------------------------------------------------------------------------- |
| 331 | +// Ask AI Sidepanel typography |
| 332 | +// |
| 333 | +// DocSearch renders AI answers into `.DocSearch-Markdown-Content`, which ships with |
| 334 | +// its own font-size/line-height that doesn't match our docs content. Override it |
| 335 | +// to use our Docusaurus/Infima typography tokens so the sidepanel reads like the |
| 336 | +// rest of the site. |
| 337 | +// ----------------------------------------------------------------------------- |
| 338 | + |
| 339 | +.DocSearch-Sidepanel { |
| 340 | + // Align base typography with the site |
| 341 | + font-family: var(--ifm-font-family-base) !important; |
| 342 | + color: var(--ifm-font-color-base); |
| 343 | + |
| 344 | + // Header title ("Ask AI") is too small by default (0.875rem in DocSearch CSS). |
| 345 | + // Make it 1.5x bigger => 1.3125rem. |
| 346 | + .DocSearch-Sidepanel-Title { |
| 347 | + font-size: 1.3125rem !important; |
| 348 | + line-height: 1.25 !important; |
| 349 | + } |
| 350 | + |
| 351 | + // Prompt disclaimer ("Answers are generated with AI..."): |
| 352 | + // set to 25% smaller than the previously increased size (1.5rem -> 1.125rem). |
| 353 | + .DocSearch-Sidepanel-Prompt--disclaimer { |
| 354 | + font-size: 1.125rem !important; |
| 355 | + line-height: 1.35 !important; |
| 356 | + } |
| 357 | + |
| 358 | + .DocSearch-Sidepanel-Screen--introduction { |
| 359 | + font-size: 1.125rem !important; |
| 360 | + line-height: 1.35 !important; |
| 361 | + } |
| 362 | + |
| 363 | + // Prompt input UI is too small by default (textarea is 1rem + compact padding). |
| 364 | + // Make it 1.5x larger: bump padding, textarea font-size, and action button size. |
| 365 | + .DocSearch-Sidepanel-Prompt--form { |
| 366 | + --prompt-form-padding: 1.125rem; // 0.75rem * 1.5 |
| 367 | + border-radius: 0.375rem; // 0.25rem * 1.5 |
| 368 | + } |
| 369 | + |
| 370 | + .DocSearch-Sidepanel-Prompt--textarea { |
| 371 | + font-family: var(--ifm-font-family-base) !important; |
| 372 | + font-size: 1.5rem !important; |
| 373 | + line-height: 1.5 !important; |
| 374 | + min-height: 2.25rem !important; // 1.5rem * 1.5 |
| 375 | + padding-right: 2.625rem !important; // 1.75rem * 1.5 |
| 376 | + } |
| 377 | + |
| 378 | + .DocSearch-Sidepanel-Prompt--actions { |
| 379 | + height: 2.25rem !important; |
| 380 | + } |
| 381 | + |
| 382 | + .DocSearch-Sidepanel-Prompt--submit, |
| 383 | + .DocSearch-Sidepanel-Prompt--stop { |
| 384 | + width: 2.25rem !important; |
| 385 | + height: 2.25rem !important; |
| 386 | + border-radius: 0.375rem !important; |
| 387 | + } |
| 388 | + |
| 389 | + .DocSearch-AskAiScreen-Query { |
| 390 | + font-family: var(--ifm-heading-font-family, var(--ifm-font-family-base)) !important; |
| 391 | + font-size: 1em !important; |
| 392 | + font-weight: 600 !important; |
| 393 | + line-height: 1.3 !important; |
| 394 | + } |
| 395 | + |
| 396 | + .DocSearch-AskAiScreen-Response, |
| 397 | + .DocSearch-Markdown-Content { |
| 398 | + font-family: var(--ifm-font-family-base) !important; |
| 399 | + font-size: var(--ifm-font-size-base, 1.6rem) !important; |
| 400 | + line-height: var(--ifm-line-height-base, 1.6) !important; |
| 401 | + } |
| 402 | + |
| 403 | + .DocSearch-Markdown-Content { |
| 404 | + p { |
| 405 | + margin: 0 0 1em; |
| 406 | + } |
| 407 | + |
| 408 | + :is(ul, ol) { |
| 409 | + margin: 0 0 1em; |
| 410 | + padding-left: 1.5em; |
| 411 | + } |
| 412 | + |
| 413 | + :is(h1, h2, h3, h4, h5, h6) { |
| 414 | + font-family: var(--ifm-heading-font-family, var(--ifm-font-family-base)) !important; |
| 415 | + font-weight: 600 !important; |
| 416 | + line-height: 1.25 !important; |
| 417 | + } |
| 418 | + |
| 419 | + :is(code, pre, kbd, samp) { |
| 420 | + font-family: var(--ifm-font-family-monospace) !important; |
| 421 | + } |
| 422 | + } |
| 423 | + |
| 424 | + // Ask AI tool-call status line ("Searched for ... found N results") |
| 425 | + // Make it slightly smaller than body markdown + use MetaMask purple |
| 426 | + // (also tints the search icon since it uses `currentColor`). |
| 427 | + .DocSearch-AskAiScreen-MessageContent-Tool.Tool--Result { |
| 428 | + font-size: 0.9em !important; |
| 429 | + color: var(--ifm-color-primary) !important; |
| 430 | + } |
| 431 | + |
| 432 | + .DocSearch-AskAiScreen-MessageContent-Tool.Tool--Result .DocSearch-AskAiScreen-MessageContent-Tool-Query { |
| 433 | + color: inherit !important; |
| 434 | + } |
| 435 | + |
| 436 | + // Ask AI inline code snippets should match our Prism/Docusaurus code blocks. |
| 437 | + .DocSearch-CodeSnippet { |
| 438 | + position: relative; |
| 439 | + margin: 1.4rem 0; |
| 440 | + border-radius: 0; |
| 441 | + overflow: hidden; |
| 442 | + } |
| 443 | + |
| 444 | + .DocSearch-CodeSnippet pre { |
| 445 | + margin: 0; |
| 446 | + background-color: var(--general-black-light); |
| 447 | + } |
| 448 | + |
| 449 | + .DocSearch-CodeSnippet code { |
| 450 | + display: block; |
| 451 | + padding: 1.6rem; |
| 452 | + font-family: var(--ifm-font-family-monospace) !important; |
| 453 | + font-size: 1.2rem; |
| 454 | + line-height: 1.5; |
| 455 | + color: var(--general-gray) !important; |
| 456 | + background: none; |
| 457 | + white-space: pre; |
| 458 | + } |
| 459 | + |
| 460 | + .DocSearch-CodeSnippet pre code { |
| 461 | + padding: 0 !important; |
| 462 | + } |
| 463 | + |
| 464 | + .DocSearch-CodeSnippet-CopyButton { |
| 465 | + position: absolute; |
| 466 | + top: 0.8rem; |
| 467 | + right: 0.8rem; |
| 468 | + display: inline-flex; |
| 469 | + align-items: center; |
| 470 | + gap: 0.4rem; |
| 471 | + padding: 0.4rem 0.6rem; |
| 472 | + border: 1px solid transparent; |
| 473 | + border-radius: 0 !important; |
| 474 | + background: transparent; |
| 475 | + color: var(--general-gray) !important; |
| 476 | + cursor: pointer; |
| 477 | + } |
| 478 | + |
| 479 | + .DocSearch-CodeSnippet-CopyButton:hover { |
| 480 | + color: var(--ifm-color-primary) !important; |
| 481 | + border-color: var(--ifm-color-primary); |
| 482 | + } |
| 483 | + |
| 484 | + .DocSearch-CodeSnippet-CopyButton-Label { |
| 485 | + display: none; |
| 486 | + } |
| 487 | + |
| 488 | + // Sidepanel "Powered by Algolia" footer: reduce overall visual size ~50% |
| 489 | + .DocSearch-Sidepanel--powered-by { |
| 490 | + transform-origin: right bottom; |
| 491 | + } |
| 492 | + |
| 493 | + .DocSearch-Sidepanel--powered-by .DocSearch-Label { |
| 494 | + font-size: 0.5em !important; |
| 495 | + } |
| 496 | + |
| 497 | + .DocSearch-Sidepanel--powered-by svg[aria-label='Algolia'] { |
| 498 | + width: 40px !important; // default is 80px |
| 499 | + height: auto !important; |
| 500 | + } |
| 501 | +} |
0 commit comments