Skip to content

Commit

Permalink
fix: Fix line number style
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Jan 22, 2025
1 parent f59a9d0 commit 4d30393
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@hayao/next-view-transitions": "0.3.4",
"@rehype-pretty/transformers": "^0.13.2",
"clsx": "^2.1.1",
"framer-motion": "11.15.0",
"gray-matter": "^4.0.3",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/components/elements/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export default async function Markdown({ content, basepath }: { content: string;
theme: "one-dark-pro",
keepBackground: true,
defaultLang: "plaintext",
// transformers: [
// transformerCopyButton({
// visibility: "always",
// feedbackDuration: 3_000,
// }),
// ],
},
],
rehypeStringify,
Expand Down
6 changes: 6 additions & 0 deletions src/style/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ figure[data-rehype-pretty-code-figure] {
content: counter(lineNumber);
counter-increment: lineNumber;
@apply text-gray-600 mr-5;

display: inline-block;
width: 0.75rem;
margin-right: 2rem;
text-align: right;
color: gray;
}

code {
Expand Down

0 comments on commit 4d30393

Please sign in to comment.