mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
@@ -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" />;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user