-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: preserve code block meta for code highlighting
close: #30
- Loading branch information
Showing
9 changed files
with
854 additions
and
899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,41 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { | ||
[data-rehype-pretty-code-figure] pre { | ||
@apply px-0; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] code { | ||
@apply text-sm !leading-loose md:text-base; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] code[data-line-numbers] { | ||
counter-reset: line; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] code[data-line-numbers] > [data-line]::before { | ||
counter-increment: line; | ||
content: counter(line); | ||
@apply mr-4 inline-block w-4 text-right text-gray-500; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] pre [data-line] { | ||
@apply border-l-2 border-l-transparent px-3; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] [data-highlighted-line] { | ||
background: rgba(200, 200, 255, 0.1); | ||
@apply border-l-blue-400; | ||
} | ||
|
||
[data-rehype-pretty-code-figure] [data-highlighted-chars] { | ||
@apply rounded bg-zinc-600/50; | ||
box-shadow: 0 0 0 4px rgb(82 82 91 / 0.5); | ||
} | ||
|
||
[data-rehype-pretty-code-figure] [data-chars-id] { | ||
@apply border-b-2 p-1 shadow-none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.