style(frontend): prettier baseline format (no logic change)

This commit is contained in:
2026-09-15 11:27:54 +08:00
parent 09a02fa0d7
commit 29167d3cea
38 changed files with 764 additions and 594 deletions
+136 -37
View File
@@ -103,15 +103,35 @@ body {
/* 入场:卡片/区块轻微上浮淡入(列表 stagger 用 style.animationDelay) */
@keyframes fx-rise {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: none; }
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: none;
}
}
.fx-rise {
animation: fx-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.fx-rise { animation: fx-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
/* 阅读页主题:纸/米/夜,文本类阅读器共用 —— 见 lib/readerPrefs.ts */
[data-rd="paper"] { --rd-bg: #faf8f4; --rd-fg: #292524; --rd-link: #9a3412; }
[data-rd="sepia"] { --rd-bg: #f0e6d2; --rd-fg: #433a29; --rd-link: #92400e; }
[data-rd="night"] { --rd-bg: #171512; --rd-fg: #c6c0b6; --rd-link: #e0a458; }
[data-rd="paper"] {
--rd-bg: #faf8f4;
--rd-fg: #292524;
--rd-link: #9a3412;
}
[data-rd="sepia"] {
--rd-bg: #f0e6d2;
--rd-fg: #433a29;
--rd-link: #92400e;
}
[data-rd="night"] {
--rd-bg: #171512;
--rd-fg: #c6c0b6;
--rd-link: #e0a458;
}
.rd-surface {
background: var(--rd-bg);
color: var(--rd-fg);
@@ -125,46 +145,125 @@ body {
@apply rounded-md px-2.5 py-1 text-sm transition-colors;
background: color-mix(in oklab, currentColor 8%, transparent);
}
.rd-btn:hover { background: color-mix(in oklab, currentColor 16%, transparent); }
.rd-btn:disabled { @apply cursor-not-allowed opacity-40; }
.rd-btn:hover {
background: color-mix(in oklab, currentColor 16%, transparent);
}
.rd-btn:disabled {
@apply cursor-not-allowed opacity-40;
}
/* 目录侧边栏行 */
.rd-row { @apply block w-full truncate rounded-md px-2.5 py-1.5 text-left text-sm transition-colors; }
.rd-row:hover { background: color-mix(in oklab, currentColor 12%, transparent); }
.rd-btn-on { @apply font-semibold; background: color-mix(in oklab, currentColor 20%, transparent); }
.rd-row {
@apply block w-full truncate rounded-md px-2.5 py-1.5 text-left text-sm transition-colors;
}
.rd-row:hover {
background: color-mix(in oklab, currentColor 12%, transparent);
}
.rd-btn-on {
@apply font-semibold;
background: color-mix(in oklab, currentColor 20%, transparent);
}
/* Radix 菜单项高亮(指针/键盘) */
.rd-highlight { outline: none; }
.rd-highlight[data-highlighted] { background: color-mix(in oklab, currentColor 16%, transparent); }
.rd-divider { border-color: color-mix(in oklab, currentColor 14%, transparent); }
.rd-highlight {
outline: none;
}
.rd-highlight[data-highlighted] {
background: color-mix(in oklab, currentColor 16%, transparent);
}
.rd-divider {
border-color: color-mix(in oklab, currentColor 14%, transparent);
}
/* 进度/页码滑条:主题色轨道 + 强调色拇指,触摸友好 */
.rd-range { @apply h-1.5 w-full cursor-pointer appearance-none rounded-full; background: color-mix(in oklab, currentColor 18%, transparent); }
.rd-range {
@apply h-1.5 w-full cursor-pointer appearance-none rounded-full;
background: color-mix(in oklab, currentColor 18%, transparent);
}
.rd-range::-webkit-slider-thumb {
@apply h-4 w-4 appearance-none rounded-full ring-2 ring-black/10; background: var(--rd-link, #f59e0b);
@apply h-4 w-4 appearance-none rounded-full ring-2 ring-black/10;
background: var(--rd-link, #f59e0b);
}
.rd-range::-moz-range-thumb {
@apply h-4 w-4 rounded-full border-0;
background: var(--rd-link, #f59e0b);
}
.rd-range::-moz-range-thumb { @apply h-4 w-4 rounded-full border-0; background: var(--rd-link, #f59e0b); }
/* 沉浸态底部工具抽屉的滑入动效 */
@keyframes rd-rise { from { transform: translateY(100%); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
.rd-sheet { animation: rd-rise 0.2s ease-out; }
@keyframes rd-rise {
from {
transform: translateY(100%);
opacity: 0.4;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.rd-sheet {
animation: rd-rise 0.2s ease-out;
}
@media (prefers-reduced-motion: reduce) {
.rd-sheet { animation: none; }
.rd-rise-anim { transition: none !important; }
.fx-rise { animation: none; }
.rd-sheet {
animation: none;
}
.rd-rise-anim {
transition: none !important;
}
.fx-rise {
animation: none;
}
}
/* markdown 正文(仅 .md-body 作用域) */
.md-body h1 { @apply mt-8 mb-3 text-2xl font-semibold; }
.md-body h2 { @apply mt-6 mb-2 text-xl font-semibold; }
.md-body h3 { @apply mt-4 mb-2 text-base font-semibold; }
.md-body p { @apply my-3; }
.md-body ul { @apply my-3 list-disc space-y-1 pl-6; }
.md-body ol { @apply my-3 list-decimal space-y-1 pl-6; }
.md-body blockquote { @apply my-3 border-l-2 pl-4; border-color: color-mix(in oklab, currentColor 30%, transparent); opacity: 0.75; }
.md-body code { @apply rounded px-1 py-0.5 text-[0.85em]; background: color-mix(in oklab, currentColor 10%, transparent); }
.md-body pre { @apply my-3 overflow-x-auto rounded-lg p-3; background: color-mix(in oklab, currentColor 6%, transparent); }
.md-body pre code { @apply bg-transparent p-0; }
.md-body a { color: var(--rd-link, #f59e0b); @apply underline underline-offset-2; }
.md-body img { @apply my-3 max-w-full rounded; }
.md-body hr { @apply my-6; border-color: color-mix(in oklab, currentColor 15%, transparent); }
.md-body table { @apply my-3 w-full border-collapse text-sm; }
.md-body th, .md-body td { @apply border px-2 py-1 text-left; border-color: color-mix(in oklab, currentColor 22%, transparent); }
.md-body h1 {
@apply mt-8 mb-3 text-2xl font-semibold;
}
.md-body h2 {
@apply mt-6 mb-2 text-xl font-semibold;
}
.md-body h3 {
@apply mt-4 mb-2 text-base font-semibold;
}
.md-body p {
@apply my-3;
}
.md-body ul {
@apply my-3 list-disc space-y-1 pl-6;
}
.md-body ol {
@apply my-3 list-decimal space-y-1 pl-6;
}
.md-body blockquote {
@apply my-3 border-l-2 pl-4;
border-color: color-mix(in oklab, currentColor 30%, transparent);
opacity: 0.75;
}
.md-body code {
@apply rounded px-1 py-0.5 text-[0.85em];
background: color-mix(in oklab, currentColor 10%, transparent);
}
.md-body pre {
@apply my-3 overflow-x-auto rounded-lg p-3;
background: color-mix(in oklab, currentColor 6%, transparent);
}
.md-body pre code {
@apply bg-transparent p-0;
}
.md-body a {
color: var(--rd-link, #f59e0b);
@apply underline underline-offset-2;
}
.md-body img {
@apply my-3 max-w-full rounded;
}
.md-body hr {
@apply my-6;
border-color: color-mix(in oklab, currentColor 15%, transparent);
}
.md-body table {
@apply my-3 w-full border-collapse text-sm;
}
.md-body th,
.md-body td {
@apply border px-2 py-1 text-left;
border-color: color-mix(in oklab, currentColor 22%, transparent);
}