Skip to content

Commit

Permalink
fix: styles for code editor embedded in admonition (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao authored Jan 8, 2025
1 parent 2de5fb9 commit e55bb7c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
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

0 comments on commit e55bb7c

Please sign in to comment.