docs(docs-infra): fix function api ref header width (#61022)

Fix the width of the function API reference header when the viewport width is for-desktop-down.

PR Close #61022
This commit is contained in:
hawkgs
2025-04-28 19:02:29 +03:00
committed by Miles Malerba
parent b2867ede8b
commit d8204bf584
3 changed files with 15 additions and 21 deletions
@@ -38,16 +38,14 @@ export const signatureCard = (
<div id={opts.id} class={REFERENCE_MEMBER_CARD}>
<header class={REFERENCE_MEMBER_CARD_HEADER}>
{printSignaturesAsHeader ? (
<code>
<HighlightTypeScript
code={printInitializerFunctionSignatureLine(
name,
signature,
// Always omit types in signature headers, to keep them short.
true,
)}
/>
</code>
<HighlightTypeScript
code={printInitializerFunctionSignatureLine(
name,
signature,
// Always omit types in signature headers, to keep them short.
true,
)}
/>
) : (
<>
<h3>{name}</h3>
@@ -15,5 +15,5 @@ export function HighlightTypeScript(props: {code: string}) {
const result = codeToHtml(props.code, 'typescript');
const withScrollTrack = result.replace(/^(<pre class="shiki)/, '$1 docs-mini-scroll-track');
return <RawHtml value={withScrollTrack} />;
return <RawHtml value={withScrollTrack} className="docs-code" />;
}
+6 -10
View File
@@ -138,20 +138,16 @@
border-radius: 0.25rem;
}
code {
font-size: 0.875rem;
overflow: hidden;
.docs-code {
flex: 1;
&:has(pre) {
padding: 0;
button[docs-copy-source-code] {
display: none;
}
}
pre {
margin: 0;
/* Do we have a better alternative ? */
overflow: auto;
code {
font-size: 0.875rem;
}
h3 {