fix: 代码风格设置

This commit is contained in:
Tim
2025-08-14 19:55:53 +08:00
parent df56d7e885
commit 84b45f785d
3 changed files with 203 additions and 195 deletions

View File

@@ -28,7 +28,7 @@
--activity-card-background-color: #fafafa;
}
[data-theme="dark"] {
[data-theme='dark'] {
--header-background-color: #2b2b2b;
--header-border-color: #555;
--primary-color: rgb(17, 182, 197);
@@ -55,7 +55,7 @@
body {
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-family: 'Roboto', sans-serif;
background-color: var(--normal-background-color);
color: var(--text-color);
/* 禁止滚动 */
@@ -132,7 +132,7 @@ body {
.info-content-text pre {
display: flex;
background-color: var(--normal-background-color);
background-color: var(--lottery-background-color);
padding: 8px 12px;
border-radius: 4px;
line-height: 1.5;
@@ -145,10 +145,9 @@ body {
font-size: 13px;
position: sticky;
flex-shrink: 0;
font-family: "Maple Mono", monospace;
font-family: 'Maple Mono', monospace;
margin: 1em 0;
color: #888;
background-color: var(--normal-background-color);
border-right: 1px solid #888;
box-sizing: border-box;
padding-right: 0.5em;
@@ -161,11 +160,11 @@ body {
}
.info-content-text code {
font-family: "Maple Mono", monospace;
font-family: 'Maple Mono', monospace;
font-size: 13px;
border-radius: 4px;
white-space: no-wrap;
background-color: var(--normal-background-color);
background-color: var(--lottery-background-color);
color: var(--text-color);
}
@@ -219,7 +218,7 @@ body {
font-weight: 600;
}
[data-theme="dark"] .info-content-text thead th {
[data-theme='dark'] .info-content-text thead th {
background-color: var(--primary-color-hover); /* 暗色稍暗一点 */
}
@@ -227,7 +226,7 @@ body {
background-color: rgba(208, 250, 255, 0.25); /* 斑马纹 */
}
[data-theme="dark"] .info-content-text tbody tr:nth-child(even) {
[data-theme='dark'] .info-content-text tbody tr:nth-child(even) {
background-color: rgba(255, 255, 255, 0.05);
}

View File

@@ -12,7 +12,7 @@ export default defineNuxtConfig({
twitterClientId: process.env.NUXT_PUBLIC_TWITTER_CLIENT_ID || '',
},
},
// Ensure Vditor styles load before our overrides in global.css
// 确保 Vditor 样式在 global.css 覆盖前加载
css: ['vditor/dist/index.css', '~/assets/fonts.css', '~/assets/global.css'],
app: {
head: {

View File

@@ -1,5 +1,14 @@
import hljs from 'highlight.js'
import 'highlight.js/styles/github.css'
if (typeof window !== 'undefined') {
const theme =
document.documentElement.dataset.theme ||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
if (theme === 'dark') {
import('highlight.js/styles/atom-one-dark.css')
} else {
import('highlight.js/styles/atom-one-light.css')
}
}
import MarkdownIt from 'markdown-it'
import { toast } from '../main'
import { tiebaEmoji } from './tiebaEmoji'