Files
Eidolon/src/styles/content.css
T

348 lines
8.7 KiB
CSS
Raw Normal View History

2026-08-12 01:11:32 +08:00
.prose {
width: 100%;
color: var(--color-text);
font-family: var(--reading-font-family);
font-size: 1.0625rem;
line-height: 1.8;
}
@media (min-width: 1456px) and (max-width: 1919px) {
:root[data-platform='windows'] .prose { font-size: 1.125rem; }
}
@media (min-width: 1920px) {
.prose { font-size: 1.125rem; }
}
@media (min-width: 2400px) {
.prose { font-size: 1.125rem; }
}
:root[data-font='serif'] .prose {
font-size: 1.125rem;
line-height: 2;
}
@media (min-width: 1920px) {
:root[data-font='serif'] .prose { font-size: 1.1875rem; }
}
.prose :where(p, li, blockquote, td, th) { overflow-wrap: anywhere; }
.prose :where(h1, h2, h3, h4) {
margin: 1.8em 0 0.65em;
font-family: var(--reading-font-family);
font-weight: 600;
line-height: 1.25;
}
.about-page .prose > :first-child { margin-top: 0; }
.prose h1 {
overflow-wrap: anywhere;
font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
line-height: 1.2;
text-wrap: balance;
}
.prose h2 {
font-size: 1.65rem;
}
.prose :where(p, ul, ol, blockquote, pre, table) {
margin-block: 1.15em;
}
.prose hr {
position: relative;
height: 1.25rem;
margin-block: 2.25em;
border: 0;
background:
linear-gradient(var(--color-border), var(--color-border)) left center / calc(50% - 0.75rem) 1px no-repeat,
linear-gradient(var(--color-border), var(--color-border)) right center / calc(50% - 0.75rem) 1px no-repeat;
}
.prose hr::after {
position: absolute;
top: 50%;
left: 50%;
width: 0.35rem;
height: 0.35rem;
border-radius: 50%;
background: var(--color-accent);
content: '';
transform: translate(-50%, -50%);
}
.prose :where(img, video) {
display: block;
max-width: 100%;
height: auto;
margin: 2em auto;
}
.prose blockquote {
margin-inline: 0;
padding: 0.2em 0 0.2em 1.2em;
border-left: 3px solid var(--color-accent);
color: var(--color-muted);
font-family: var(--reading-font-family);
font-size: 1.08em;
}
.prose :not(pre) > code {
padding: 0.2em 0.45em;
border-radius: var(--radius-sm);
background: var(--color-code);
font-family: var(--mirages-font-code);
font-size: .9em;
}
:root[data-theme='dark'] .prose :not(pre) > code {
background: #464242;
}
@media (prefers-color-scheme: dark) {
:root[data-theme='auto'] .prose :not(pre) > code {
background: #464242;
}
}
.prose pre {
max-width: 100%;
overflow-x: auto;
padding: 1rem;
border: 0;
border-radius: var(--radius-sm);
background: var(--color-code);
color: var(--shiki-light, var(--color-text));
scrollbar-color: color-mix(in srgb, var(--color-muted) 60%, transparent) transparent;
scrollbar-width: thin;
}
.prose pre::-webkit-scrollbar { height: 8px; }
.prose pre::-webkit-scrollbar-thumb { border-radius: 4px; background: color-mix(in srgb, var(--color-muted) 60%, transparent); }
.prose pre::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--color-muted) 78%, transparent); }
.prose pre code {
display: block;
min-width: max-content;
font-family: var(--mirages-font-code);
font-size: .875rem;
line-height: 1.45;
2026-08-13 00:26:08 +08:00
white-space: pre;
2026-08-12 01:11:32 +08:00
}
2026-08-13 00:26:08 +08:00
.prose .astro-code {
2026-08-12 01:11:32 +08:00
--code-line-digits: 1;
2026-08-13 00:26:08 +08:00
--code-gutter-background: color-mix(in srgb, var(--color-code) 65%, var(--color-border));
padding: 0;
overflow: hidden;
position: relative;
background: var(--color-code);
}
.prose .astro-code code {
2026-08-12 01:11:32 +08:00
display: block;
2026-08-13 00:26:08 +08:00
position: relative;
overflow-x: auto;
overflow-y: hidden;
overscroll-behavior-x: none;
width: 100%;
min-width: 0;
2026-08-12 01:11:32 +08:00
padding-block: 1rem;
counter-reset: code-line;
font-size: .875rem;
line-height: 1.45;
2026-08-13 00:26:08 +08:00
scrollbar-color: color-mix(in srgb, var(--color-muted) 60%, transparent) transparent;
scrollbar-width: thin;
white-space: normal;
2026-08-12 01:11:32 +08:00
}
2026-08-13 00:26:08 +08:00
.prose .astro-code code::-webkit-scrollbar { height: 8px; }
.prose .astro-code code::-webkit-scrollbar-thumb { border-radius: 4px; background: color-mix(in srgb, var(--color-muted) 60%, transparent); }
.prose .astro-code code::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--color-muted) 78%, transparent); }
.prose .astro-code:has(.line:nth-child(10)) { --code-line-digits: 2; }
.prose .astro-code:has(.line:nth-child(100)) { --code-line-digits: 3; }
.prose .astro-code:has(.line:nth-child(1000)) { --code-line-digits: 4; }
.prose .astro-code .code-line-numbers {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 20;
display: block;
2026-08-12 01:11:32 +08:00
width: calc(var(--code-line-digits) * 1ch + 2rem);
2026-08-13 00:26:08 +08:00
padding-block: 1rem;
font-family: var(--mirages-font-code);
font-size: .875rem;
line-height: 1.45;
background: var(--code-gutter-background);
border-right: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
2026-08-12 01:11:32 +08:00
box-sizing: border-box;
color: var(--color-muted);
font-variant-numeric: tabular-nums;
text-align: right;
user-select: none;
2026-08-13 00:26:08 +08:00
pointer-events: none;
2026-08-12 01:11:32 +08:00
}
2026-08-13 00:26:08 +08:00
.prose .astro-code .code-line-numbers > span {
display: block;
height: 1.45em;
padding-inline: 1rem;
box-sizing: border-box;
color: inherit;
2026-08-12 01:11:32 +08:00
}
2026-08-13 00:26:08 +08:00
.prose .astro-code .line {
display: block;
width: max-content;
min-width: 100%;
min-height: 1.45em;
padding-left: calc(var(--code-line-digits) * 1ch + 3rem);
box-sizing: border-box;
counter-increment: code-line;
font-size: .875rem;
line-height: 1.45;
white-space: pre;
2026-08-12 01:11:32 +08:00
}
2026-08-13 00:26:08 +08:00
.prose .astro-code .line::before {
content: none;
2026-08-12 01:11:32 +08:00
}
.prose .astro-code span {
color: var(--shiki-light);
}
:root[data-theme='dark'] .prose .astro-code {
2026-08-13 00:26:08 +08:00
--code-gutter-background: var(--color-code-gutter);
--shortcode-code-gutter: var(--color-code-gutter);
2026-08-12 01:11:32 +08:00
background-color: var(--color-code);
color: var(--shiki-dark);
}
:root[data-theme='dark'] .prose .astro-code span {
color: var(--shiki-dark);
}
@media (prefers-color-scheme: dark) {
:root[data-theme='auto'] .prose .astro-code {
2026-08-13 00:26:08 +08:00
--code-gutter-background: var(--color-code-gutter);
--shortcode-code-gutter: var(--color-code-gutter);
2026-08-12 01:11:32 +08:00
background-color: var(--color-code);
color: var(--shiki-dark);
}
:root[data-theme='auto'] .prose .astro-code span {
color: var(--shiki-dark);
}
}
2026-08-13 00:26:08 +08:00
.shortcode-code {
--shortcode-code-gutter: color-mix(in srgb, var(--color-code) 65%, var(--color-border));
2026-08-12 01:11:32 +08:00
padding: 0;
2026-08-13 00:26:08 +08:00
overflow: hidden;
position: relative;
}
.shortcode-code code {
display: block;
position: relative;
overflow-x: auto;
overflow-y: hidden;
overscroll-behavior-x: none;
width: 100%;
min-width: 0;
padding-block: 1rem;
font-size: .875rem;
line-height: 1.45;
scrollbar-color: color-mix(in srgb, var(--color-muted) 60%, transparent) transparent;
scrollbar-width: thin;
white-space: normal;
}
.shortcode-code code::-webkit-scrollbar { height: 8px; }
.shortcode-code code::-webkit-scrollbar-thumb { border-radius: 4px; background: color-mix(in srgb, var(--color-muted) 60%, transparent); }
.shortcode-code code::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--color-muted) 78%, transparent); }
.shortcode-code .line {
display: block;
width: max-content;
min-width: 100%;
min-height: 1.45em;
padding-left: 4rem;
box-sizing: border-box;
font-size: .875rem;
line-height: 1.45;
white-space: pre;
}
.shortcode-code .shortcode-line-number {
display: none;
2026-08-12 01:11:32 +08:00
}
.prose .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: .35em; }
.prose .mermaid { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 1rem 0; }
.prose .mermaid svg { max-width: none; height: auto; }
2026-08-13 00:26:08 +08:00
.prose .table-scroll {
width: 100%;
max-width: 100%;
margin: 1.25em 0;
overflow-x: auto;
overscroll-behavior-inline: contain;
scrollbar-color: color-mix(in srgb, var(--color-muted) 60%, transparent) transparent;
scrollbar-width: thin;
}
.prose .table-scroll::-webkit-scrollbar { height: 8px; }
.prose .table-scroll::-webkit-scrollbar-thumb { border-radius: 4px; background: color-mix(in srgb, var(--color-muted) 60%, transparent); }
2026-08-12 01:11:32 +08:00
.prose table {
width: 100%;
2026-08-13 00:26:08 +08:00
max-width: 100%;
margin: 0;
2026-08-12 01:11:32 +08:00
border-collapse: collapse;
2026-08-13 00:26:08 +08:00
table-layout: auto;
2026-08-12 01:11:32 +08:00
}
.prose thead {
background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
}
.prose tbody tr:nth-child(odd) {
background: color-mix(in srgb, var(--color-text) 4%, transparent);
}
.prose :where(th, td) img {
display: inline-block;
max-width: 100%;
height: auto;
margin: 0;
vertical-align: middle;
}
.prose :where(th, td) {
padding: 0.55em 0.8em;
border: 1px solid var(--color-border);
2026-08-13 00:26:08 +08:00
overflow-wrap: anywhere;
word-break: break-word;
white-space: normal;
}
@media (max-width: 48rem) {
.prose .responsive-table {
width: max(100%, calc(var(--table-columns, 1) * 8rem));
}
2026-08-12 01:11:32 +08:00
}
.prose :where(th, td)[align='left'] { text-align: left; }
.prose :where(th, td)[align='center'] { text-align: center; }
.prose :where(th, td)[align='right'] { text-align: right; }