优化页面、修复BUG
This commit is contained in:
252
client/src/styles/articleExport.css
Normal file
252
client/src/styles/articleExport.css
Normal file
@@ -0,0 +1,252 @@
|
||||
/**
|
||||
* 文章离屏导出样式(PDF / PNG 共用)
|
||||
* 支持浅色打印风格与深色页面风格
|
||||
*/
|
||||
|
||||
.article-export-root {
|
||||
width: 800px;
|
||||
padding: 48px 40px;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Noto Sans SC', 'Inter', system-ui, sans-serif;
|
||||
line-height: 1.75;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* ---------- 浅色导出主题 ---------- */
|
||||
.export-theme-light {
|
||||
background: #ffffff;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.export-theme-light .export-header {
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
padding-bottom: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.export-theme-light .export-meta {
|
||||
color: #6b7280;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.export-theme-light .export-category {
|
||||
color: #92400e;
|
||||
background: #fef3c7;
|
||||
border: 1px solid #fde68a;
|
||||
}
|
||||
|
||||
.export-theme-light .export-title {
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body h1,
|
||||
.export-theme-light .export-body h2,
|
||||
.export-theme-light .export-body h3,
|
||||
.export-theme-light .export-body h4 {
|
||||
color: #111827;
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body h2 {
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
padding-bottom: 0.4em;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body a {
|
||||
color: #b45309;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body blockquote {
|
||||
border-left: 3px solid #d4b383;
|
||||
background: #f9fafb;
|
||||
color: #4b5563;
|
||||
padding: 0.8rem 1.2rem;
|
||||
border-radius: 0 0.5rem 0.5rem 0;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body :not(pre) > code {
|
||||
color: #92400e;
|
||||
background: #fef3c7;
|
||||
padding: 0.15em 0.35em;
|
||||
border-radius: 0.25em;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body .ios-code-container {
|
||||
background: #f3f4f6 !important;
|
||||
border: 1px solid #e5e7eb !important;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body .mac-window-header {
|
||||
background: #e5e7eb !important;
|
||||
border-bottom: 1px solid #d1d5db !important;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body .line-numbers-wrapper,
|
||||
.export-theme-light .export-body .code-block-wrapper {
|
||||
background: #f9fafb !important;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body .line-numbers-wrapper {
|
||||
border-right: 1px solid #e5e7eb !important;
|
||||
color: #9ca3af !important;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body img {
|
||||
max-width: 100%;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.export-theme-light .export-body th,
|
||||
.export-theme-light .export-body td {
|
||||
border: 1px solid #e5e7eb;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
/* ---------- 深色导出主题 ---------- */
|
||||
.export-theme-dark {
|
||||
background: #050505;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.export-theme-dark .export-header {
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding-bottom: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-meta {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-category {
|
||||
color: #d4b383;
|
||||
background: rgba(212, 179, 131, 0.1);
|
||||
border: 1px solid rgba(212, 179, 131, 0.3);
|
||||
}
|
||||
|
||||
.export-theme-dark .export-title {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body h1,
|
||||
.export-theme-dark .export-body h2,
|
||||
.export-theme-dark .export-body h3,
|
||||
.export-theme-dark .export-body h4 {
|
||||
color: #ffffff;
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body h2 {
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding-bottom: 0.4em;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body h3 {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body a {
|
||||
color: #d4b383;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body blockquote {
|
||||
border-left: 3px solid #d4b383;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
padding: 0.8rem 1.2rem;
|
||||
border-radius: 0 0.5rem 0.5rem 0;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body :not(pre) > code {
|
||||
color: #d4b383;
|
||||
background: rgba(212, 179, 131, 0.1);
|
||||
padding: 0.15em 0.35em;
|
||||
border-radius: 0.25em;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body .ios-code-container {
|
||||
background: #1e1e1e !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body .mac-window-header {
|
||||
background: #282828 !important;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body .line-numbers-wrapper,
|
||||
.export-theme-dark .export-body .code-block-wrapper {
|
||||
background: #1e1e1e !important;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body .line-numbers-wrapper {
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
|
||||
color: rgba(255, 255, 255, 0.2) !important;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body img {
|
||||
max-width: 100%;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.export-theme-dark .export-body th,
|
||||
.export-theme-dark .export-body td {
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
/* ---------- 公共结构 ---------- */
|
||||
.export-header-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.export-category {
|
||||
display: inline-block;
|
||||
padding: 2px 10px;
|
||||
border-radius: 9999px;
|
||||
font-size: 11px;
|
||||
font-family: ui-monospace, monospace;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.export-title {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.export-author {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.export-body {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.export-body h1 { font-size: 1.75rem; margin-top: 1.5em; margin-bottom: 0.6em; }
|
||||
.export-body h2 { font-size: 1.5rem; margin-top: 1.5em; margin-bottom: 0.6em; }
|
||||
.export-body h3 { font-size: 1.25rem; margin-top: 1.25em; margin-bottom: 0.5em; }
|
||||
.export-body p { margin: 0.75em 0; }
|
||||
.export-body ul, .export-body ol { padding-left: 1.5em; margin: 0.75em 0; }
|
||||
.export-body pre { margin: 0; overflow: visible; white-space: pre-wrap; word-break: break-word; }
|
||||
.export-body img { display: block; margin: 1em auto; }
|
||||
Reference in New Issue
Block a user