style(mdx): Add subheading anchor style, underline on hover

- Added `subheading-anchor` style to control subheading anchor display.
- Removed default underline and added underline on hover for improved user experience.
This commit is contained in:
cfngc4594 2025-02-23 15:02:55 +08:00
parent f7e94564be
commit 269f41525b

View File

@ -10,7 +10,7 @@
counter-reset: line; counter-reset: line;
} }
[data-rehype-pretty-code-figure] code[data-line-numbers]>[data-line]::before { [data-rehype-pretty-code-figure] code[data-line-numbers] > [data-line]::before {
counter-increment: line; counter-increment: line;
content: counter(line); content: counter(line);
@apply mr-4 inline-block w-4 text-right text-gray-500; @apply mr-4 inline-block w-4 text-right text-gray-500;
@ -33,3 +33,7 @@
[data-rehype-pretty-code-figure] [data-chars-id] { [data-rehype-pretty-code-figure] [data-chars-id] {
@apply border-b-2 p-1 shadow-none; @apply border-b-2 p-1 shadow-none;
} }
.subheading-anchor {
@apply no-underline hover:underline;
}