From 64df235e98091032328a6fd81e3da6c3cdc4b07b Mon Sep 17 00:00:00 2001 From: MCKero6423 <222912022+MCKero6423@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BD=91=E5=8F=8B=E6=89=80?= =?UTF-8?q?=E8=AF=B4=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/markdown.css | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/styles/markdown.css b/src/styles/markdown.css index 9741e3f..d01c176 100644 --- a/src/styles/markdown.css +++ b/src/styles/markdown.css @@ -3,7 +3,12 @@ @apply text-3xl; } - h1, h2, h3, h4, h5, h6 { + h1, + h2, + h3, + h4, + h5, + h6 { .anchor { @apply transition -m-0.5 ml-[0.2ch] p-0.5 select-none opacity-0 no-underline !important; @@ -19,13 +24,14 @@ } } + /* https://github.com/afoim/fuwari/blob/main/src/styles/markdown.css */ a:not(.no-styling) { - @apply relative bg-none link font-medium text-[var(--primary)] - underline decoration-[var(--link-underline)] decoration-1 decoration-dashed underline-offset-4; + @apply relative bg-none transition rounded-md p-1 -m-1 font-medium text-[var(--primary)] before:ease-out before:transition active:bg-none hover:before:bg-[var(--btn-plain-bg-hover)] active:before:bg-[var(--btn-plain-bg-active)] z-0 before:absolute before:rounded-[inherit] before:inset-0 before:scale-[0.85] hover:before:scale-100 before:-z-10 underline decoration-[var(--link-underline)] decoration-1 decoration-dashed underline-offset-4; box-decoration-break: clone; -webkit-box-decoration-break: clone; - - &:hover, &:active { + + &:hover, + &:active { @apply decoration-transparent; background: var(--btn-plain-bg-hover); border-bottom: 1px dashed var(--link-hover); @@ -37,14 +43,17 @@ @apply bg-[var(--inline-code-bg)] text-[var(--inline-code-color)] px-1 py-0.5 rounded-md overflow-hidden; font-family: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; + &:before { - content:none; + content: none; } + &:after { - content:none; + content: none; } counter-reset: line; + span.line { &:before { @apply text-white/25 mr-4 w-4 inline-block; @@ -52,7 +61,9 @@ counter-increment: line; direction: rtl; } - &:last-child:empty, &:last-child:has(> span:empty:only-child) { + + &:last-child:empty, + &:last-child:has(> span:empty:only-child) { display: none; } } @@ -64,13 +75,15 @@ .expressive-code { @apply my-4; + ::selection { @apply bg-[var(--codeblock-selection)]; } } - ul, ol { + ul, + ol { li::marker { @apply text-[var(--primary)]; } @@ -85,7 +98,8 @@ } /* Remove the double quotes from default styles */ - p:before, p:after { + p:before, + p:after { @apply content-none; } @@ -96,5 +110,5 @@ overflow-x: auto; margin: 1em 0; } - -} + +} \ No newline at end of file