Content-Length: 334114 | pFad | http://github.com/typescript-eslint/typescript-eslint/pull/10019/files

62 docs(website): open in playground button should not cover text by mdm317 · Pull Request #10019 · typescript-eslint/typescript-eslint · GitHub
Skip to content

docs(website): open in playground button should not cover text #10019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
11 changes: 8 additions & 3 deletions packages/website/src/theme/CodeBlock/Content/String.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ export default function CodeBlockString({
const showLineNumbers =
showLineNumbersProp ?? containsLineNumbers(metastring);

const copiedCode = code
const codeLines = code
.split('\n')
.filter(
(c, i) =>
!(lineClassNames[i] as string[] | undefined)?.includes(
'code-block-removed-line',
),
)
.join('\n');
);
const copiedCode = codeLines.join('\n');
const lastLineOfCodeLength = codeLines.at(-1)?.length ?? 0;
const needsMorePadding = lastLineOfCodeLength > 50;

const eslintrcHash = parseEslintrc(metastring);

Expand Down Expand Up @@ -90,6 +92,9 @@ export default function CodeBlockString({
<code
className={clsx(
styles.codeBlockLines,
eslintrcHash &&
needsMorePadding &&
styles.codeBlockLinesMorePadding,
showLineNumbers && styles.codeBlockLinesWithNumbering,
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
padding: var(--ifm-pre-padding);
}

.codeBlockLinesMorePadding {
padding: var(--ifm-pre-padding) var(--ifm-pre-padding)
calc(var(--ifm-pre-padding) * 2.5);
}

.codeBlockLinesWithNumbering {
display: table;
padding: var(--ifm-pre-padding) 0;
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/typescript-eslint/typescript-eslint/pull/10019/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy