Skip to content

Commit

Permalink
feat: add code-block-error-line
Browse files Browse the repository at this point in the history
  • Loading branch information
eunbae0 committed Feb 16, 2024
1 parent 9ddf626 commit 316f162
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ const config: Config = {
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
magicComments: [
{
className: "theme-code-block-highlighted-line",
line: "highlight-next-line",
block: { start: "highlight-start", end: "highlight-end" },
},
{
className: "code-block-error-line",
line: "error-next-line",
},
],
},
colorMode: {
defaultMode: "dark",
Expand Down
8 changes: 8 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@
--ifm-color-primary-lightest: #7ddd93;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

.code-block-error-line {
background-color: #ff000020;
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
border-left: 3px solid #ff000080;
}

0 comments on commit 316f162

Please sign in to comment.