feat: add line numbers for code blocks

This commit is contained in:
saicaca 2024-01-25 16:09:00 +08:00
parent d831f4f5ca
commit 8b8a765d56
1 changed files with 10 additions and 1 deletions

View File

@ -61,10 +61,20 @@ const className = Astro.props.class;
padding: 0.125rem 0.25rem
border-radius: 0.25rem
overflow: hidden
counter-reset: line
&:before
content: none
&:after
content: none
span.line
&:before
content: counter(line)
counter-increment: line
direction: rtl
display: inline-block
margin-right: 1rem
width: 1.375rem
color: rgba(255, 255, 255, 0.25)
pre
background: var(--codeblock-bg) !important
border-radius: 0.75rem
@ -127,7 +137,6 @@ const className = Astro.props.class;
@layer components {
.custom-md h1 {
@apply text-3xl
}
}