feat: markdown style

This commit is contained in:
tim
2025-07-21 23:07:03 +08:00
parent 846b265b9a
commit 929b9baa0c
4 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -112,13 +112,14 @@ body {
padding: 2px 6px; padding: 2px 6px;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
background-color: var(--primary-color); background-color: white;
color: #fff; opacity: 0.8;
color: black;
cursor: pointer; cursor: pointer;
} }
.copy-code-btn:hover { .copy-code-btn:hover {
background-color: var(--primary-color-hover); opacity: 1;
} }
.info-content-text code { .info-content-text code {
@@ -126,6 +127,8 @@ body {
font-size: 13px; font-size: 13px;
border-radius: 4px; border-radius: 4px;
white-space: pre-wrap; white-space: pre-wrap;
background-color: var(--normal-background-color);
color: var(--text-color);
} }
.info-content-text a { .info-content-text a {
@@ -93,7 +93,6 @@ export default {
onMounted(() => { onMounted(() => {
vditorInstance.value = new Vditor(props.editorId, { vditorInstance.value = new Vditor(props.editorId, {
placeholder: '请输入正文...', placeholder: '请输入正文...',
height: 450,
theme: getEditorTheme(), theme: getEditorTheme(),
preview: { preview: {
theme: { current: getPreviewTheme() }, theme: { current: getPreviewTheme() },
+1 -1
View File
@@ -14,7 +14,7 @@ const md = new MarkdownIt({
} else { } else {
code = hljs.highlightAuto(str).value code = hljs.highlightAuto(str).value
} }
return `<pre class="code-block"><button class="copy-code-btn">复制</button><code class="hljs language-${lang || ''}">${code}</code></pre>` return `<pre class="code-block"><button class="copy-code-btn">Copy</button><code class="hljs language-${lang || ''}">${code}</code></pre>`
} }
}) })
@@ -359,6 +359,7 @@ export default {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 20px; margin-top: 20px;
padding-bottom: 50px;
} }
@media (max-width: 768px) { @media (max-width: 768px) {