Skip to content

Commit ad0468d

Browse files
committed
extraContent now formatted correctly.
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
1 parent 86f4610 commit ad0468d

2 files changed

Lines changed: 86 additions & 3 deletions

File tree

src/components/ParserOpenRPC/DetailsBox/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,23 @@ export default function DetailsBox({
5656
</p>
5757
)}
5858
{description !== null && (
59-
<div className={clsx("padding-top--md", styles.methodDescription)}>
59+
<div className={clsx('padding-top--md', styles.methodDescription)}>
6060
<MDContent content={description} />
6161
</div>
6262
)}
63-
{extraContent && <div className="padding-top--lg">{extraContent}</div>}
63+
{extraContent && (
64+
<div className={clsx('padding-top--lg', styles.extraContent)}>{extraContent}</div>
65+
)}
6466
<Heading
6567
as="h2"
6668
className={clsx(styles.secondaryHeading, 'padding-top--lg padding-bottom--md')}>
6769
Parameters
6870
</Heading>
6971
<div className={styles.paramContainer}>
7072
{params.length === 0 ? (
71-
<div className={clsx("padding-vert--md", styles.noParamsDescription)}>This method doesn't accept any parameters.</div>
73+
<div className={clsx('padding-vert--md', styles.noParamsDescription)}>
74+
This method doesn't accept any parameters.
75+
</div>
7276
) : (
7377
params && renderParamSchemas(params, components)
7478
)}

src/components/ParserOpenRPC/DetailsBox/styles.module.scss

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,85 @@
394394
line-height: 1.5;
395395
}
396396

397+
// Styles for extraContent to match the rest of the component
398+
.extraContent {
399+
font-size: 1.4rem;
400+
line-height: 1.5;
401+
color: var(--ifm-color-content);
402+
403+
// Ensure paragraphs match
404+
p {
405+
font-size: 1.4rem;
406+
line-height: 1.5;
407+
margin-bottom: 1rem;
408+
}
409+
410+
// Ensure lists match
411+
ul,
412+
ol {
413+
font-size: 1.4rem !important;
414+
line-height: 1.5;
415+
margin: 0.5rem 0;
416+
}
417+
418+
li {
419+
font-size: 1.4rem !important;
420+
line-height: 1.5;
421+
}
422+
423+
// Ensure headings are proportional
424+
h1,
425+
h2,
426+
h3,
427+
h4,
428+
h5,
429+
h6 {
430+
font-size: 1.6rem;
431+
font-weight: 600;
432+
margin-bottom: 0.5rem;
433+
}
434+
435+
// Ensure code blocks match
436+
code {
437+
font-family: var(--font-mm-sans-mono);
438+
font-size: 1.2rem;
439+
padding-left: 0.5rem;
440+
padding-right: 0.5rem;
441+
background: var(--ifm-code-background);
442+
border-radius: 0.4rem;
443+
}
444+
445+
// Ensure links match
446+
a {
447+
color: var(--ifm-link-color);
448+
text-decoration: underline;
449+
text-decoration-color: var(--ifm-link-color);
450+
text-decoration-thickness: 0.1rem;
451+
text-underline-offset: 0.4rem;
452+
transition: color var(--ifm-transition-fast) var(--ifm-transition-timing-default);
453+
font-weight: 500;
454+
455+
&:hover {
456+
color: var(--ifm-link-hover-color);
457+
text-decoration: underline;
458+
text-decoration-color: var(--ifm-link-hover-color);
459+
text-decoration-thickness: 0.1rem;
460+
text-underline-offset: 0.4rem;
461+
}
462+
}
463+
464+
// Ensure Docusaurus admonitions match the component font size
465+
:global(.alert) {
466+
font-size: 1.4rem;
467+
line-height: 1.5;
468+
469+
p {
470+
font-size: 1.4rem;
471+
line-height: 1.5;
472+
}
473+
}
474+
}
475+
397476
html[data-theme='dark'] {
398477
.paramWrapper,
399478
.borderWrapper,

0 commit comments

Comments
 (0)