Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/components/codeBlock/code-blocks.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
border-radius: 0 0 6px 6px;
margin-top: 0;
margin-bottom: 0;
/* Wrap overly long lines so blocks never expand layout */
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: anywhere;
max-width: 100%;
tab-size: 2;
}

code[class*='language-'],
Expand All @@ -20,6 +26,10 @@
border: 1px solid var(--accent-11);
border-radius: 6px;
margin: 0;
/* Ensure syntax-highlighted pre behaves like above */
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: anywhere;
}

/**
Expand Down Expand Up @@ -66,6 +76,10 @@
float: left;
min-width: 100%;
box-sizing: border-box;
/* Allow wrapping inside each highlighted line */
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: anywhere;
// Set placeholder for highlight accent border color to transparent
border-left: 4px solid rgba(0, 0, 0, 0);

Expand Down
6 changes: 4 additions & 2 deletions src/components/docPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export function DocPage({
'prose-blockquote:font-normal prose-blockquote:border-l-[3px] prose-em:font-normal prose-blockquote:text-[var(--gray-12)]',
'prose-img:my-2',
'prose-strong:text-[var(--gray-12)]',
fullWidth ? 'max-w-none w-full' : 'w-full',
// Allow flex item to shrink within layout; prevents long content from
// forcing the main column to grow and squeezing the ToC
fullWidth ? 'max-w-none w-full min-w-0' : 'w-full min-w-0',
].join(' ')}
id="doc-content"
>
Expand Down Expand Up @@ -117,7 +119,7 @@ export function DocPage({
{hasToc && (
<aside
data-layout-anchor="right"
className="sticky h-[calc(100vh-var(--header-height))] top-[var(--header-height)] overflow-y-auto hidden toc:block w-[250px]"
className="sticky h-[calc(100vh-var(--header-height))] top-[var(--header-height)] overflow-y-auto hidden toc:block flex-none w-[250px] min-w-[250px]"
>
<div className="sidebar">
<SidebarTableOfContents />
Expand Down
Loading