Skip to content
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

fix: styles for code editor embedded in admonition #963

Merged
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
2 changes: 1 addition & 1 deletion src/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ table {
}

html[data-theme='dark'] {
.alert pre code {
.alert pre {
background-color: #181132;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/theme/Admonition/Layout/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

.content {
display: inline-block;
width: 100%;

> p:first-of-type {
display: inline;
Expand Down
3 changes: 1 addition & 2 deletions src/theme/CodeBlock/Content/String.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ export default function CodeBlockString({
{title && <div className={styles.codeBlockTitle}>{title}</div>}
<div className={styles.codeBlockContent}>
<Highlight theme={prismTheme} code={code} language={language ?? 'text'}>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
{({ className, tokens, getLineProps, getTokenProps }) => (
<pre
ref={wordWrap.codeBlockRef}
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
className={clsx(className, styles.codeBlock, 'thin-scrollbar')}
style={style}
>
<code
className={clsx(
Expand Down
1 change: 1 addition & 0 deletions src/theme/CodeBlock/Content/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* rtl:ignore */
direction: ltr;
border-radius: inherit;
width: 100%;
}

.codeBlockTitle {
Expand Down
Loading