feat: restyle heading links

This commit is contained in:
DIYgod
2023-06-07 22:49:57 +01:00
parent b3c09c80d2
commit 57fb98e799
2 changed files with 10 additions and 21 deletions
+7 -15
View File
@@ -20,23 +20,15 @@
}
.prose .xlog-anchor {
@apply text-base align-middle h-full;
@apply ml-1 opacity-0 transition-opacity hover:no-underline;
}
.prose .xlog-anchor > span {
@apply w-5 pr-1 -ml-5 text-zinc-900 hidden;
}
.prose .xlog-anchor > div {
@apply inline;
}
.prose h2:hover .xlog-anchor > span,
.prose h3:hover .xlog-anchor > span,
.prose h4:hover .xlog-anchor > span,
.prose h5:hover .xlog-anchor > span,
.prose h6:hover .xlog-anchor > span {
@apply inline-block;
.prose h2:hover .xlog-anchor,
.prose h3:hover .xlog-anchor,
.prose h4:hover .xlog-anchor,
.prose h5:hover .xlog-anchor,
.prose h6:hover .xlog-anchor {
@apply opacity-100;
}
.prose h2 {
+3 -6
View File
@@ -156,6 +156,7 @@ export const renderPageContent = (
.use(rehypeVideo, { env })
.use(rehypeSlug)
.use(rehypeAutolinkHeadings, {
behavior: "append",
properties: {
className: ["xlog-anchor"],
ariaHidden: true,
@@ -164,12 +165,8 @@ export const renderPageContent = (
content(node) {
return [
{
type: "element",
tagName: "span",
properties: {
className: ["icon-[mingcute--link-line]"],
},
children: [],
type: "text",
value: "#",
},
]
},