feat: add heading anchor links

This commit is contained in:
saicaca
2023-11-12 19:35:53 +08:00
parent cff918dab3
commit 83e22e7e59
4 changed files with 73 additions and 7 deletions

View File

@@ -13,6 +13,20 @@ const className = Astro.props.class;
<style lang="stylus" is:global>
.custom-md
h1,h2,h3,h4,h5,h6
a
margin: -2px
padding: 2px
.anchor
margin-left: 0.2ch
opacity: 0
transition: opacity 0.15s ease-in-out, background 0.15s ease-in-out
.anchor-icon
margin-left: 0.45ch
margin-right: 0.45ch
&:hover
.anchor
opacity: 1
a
position: relative
background: none