Files
fuwari/src/styles/markdown.css
Hasenpfote cb6f97fc49
Some checks failed
Code quality / quality (push) Failing after 3s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 4s
Build and Check / Astro Build for Node.js 22 (push) Failing after 4s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s
fix: resolve katex-display scrollbar issues (#326)
* fix: resolve katex-display scrollbar issues

* style: add katex display container styles for better responsiveness

* fix: enhance katex display handling with scrollable containers and intersection observer

---------

Co-authored-by: L4Ph <4ranci0ne@gmail.com>
2025-05-18 12:26:59 +09:00

102 lines
2.5 KiB
CSS

.custom-md {
h1 {
@apply text-3xl;
}
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;
.anchor-icon {
@apply mx-[0.45ch] !important;
}
}
&:hover {
.anchor {
@apply opacity-100 !important;
}
}
}
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;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
&:hover, &:active {
@apply decoration-transparent;
background: var(--btn-plain-bg-hover);
border-bottom: 1px dashed var(--link-hover);
text-decoration: none;
}
}
code {
@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;
}
&:after {
content:none;
}
counter-reset: line;
span.line {
&:before {
@apply text-white/25 mr-4 w-4 inline-block;
content: counter(line);
counter-increment: line;
direction: rtl;
}
&:last-child:empty, &:last-child:has(> span:empty:only-child) {
display: none;
}
}
}
pre {
@apply bg-[var(--codeblock-bg)] !important;
@apply rounded-xl px-5;
code {
@apply bg-transparent text-inherit text-sm p-0;
::selection {
@apply bg-[var(--codeblock-selection)];
}
}
}
ul, ol {
li::marker {
@apply text-[var(--primary)];
}
}
blockquote {
@apply not-italic border-transparent relative;
font-weight: inherit;
&:before {
@apply content-[''] absolute -left-1 block transition bg-[var(--btn-regular-bg)] h-full w-1 rounded-full;
}
/* Remove the double quotes from default styles */
p:before, p:after {
@apply content-none;
}
}
.katex-display-container {
max-width: 100%;
overflow-x: auto;
margin: 1em 0;
}
}