Skip to content

Commit 2b4e1e1

Browse files
committed
Display code blocks in reference descriptions as blocks without highlighting
1 parent 080e313 commit 2b4e1e1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/layouts/ReferenceItemLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const seenParams: Record<string, true> = {};
8989
<div class="col-span-9 xl:min-w-[1000px]">
9090
<div
9191
set:html={description}
92-
class="[&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark mb-xl"
92+
class="[&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark mb-xl reference-item"
9393
/>
9494
{
9595
examples && (

styles/global.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ section,
232232
}
233233
}
234234

235-
.astro-code {
235+
.astro-code,
236+
.reference-item pre {
236237
margin-top: var(--spacing-md);
237238
margin-bottom: var(--spacing-md);
238239
}
@@ -245,7 +246,8 @@ section,
245246
}
246247

247248
.astro-code,
248-
.code-box {
249+
.code-box,
250+
.reference-item pre {
249251
background-color: var(--bg-gray-40) !important;
250252
padding: var(--spacing-sm);
251253
max-width: 100%;
@@ -262,10 +264,15 @@ section,
262264
}
263265
}
264266

267+
.reference-item pre code {
268+
background-color: transparent;
269+
}
270+
265271
.astro-code pre,
266272
pre.astro-code,
267273
.code-box pre,
268-
pre.code-box {
274+
pre.code-box,
275+
.reference-item pre {
269276
white-space: break-spaces;
270277
}
271278

0 commit comments

Comments
 (0)