Browse Source

style(markdown): update styles for markdown components and improve code block presentation

- Changed markdown background to transparent for better integration with surrounding elements.
- Enhanced the appearance of markdown code blocks with rounded corners, padding, and box shadows for improved readability.
- Updated font family for code elements to ensure consistency and better aesthetics.
- Commented out submit buttons in post creation and editing forms for future implementation.

These changes refine the visual presentation of markdown content and prepare the UI for upcoming features.
main
npmrun 3 weeks ago
parent
commit
f17cbb0aa9
  1. 44
      app/assets/scss/markdown/green.scss
  2. 4
      app/pages/me/posts/[id].vue
  3. 4
      app/pages/me/posts/new.vue
  4. BIN
      packages/drizzle-pkg/db.sqlite

44
app/assets/scss/markdown/green.scss

@ -22,7 +22,7 @@
} }
.markdown-body { .markdown-body {
--color-base: #ef4444; --color-base: #ef4444;
--markdown-bg: white; --markdown-bg: transparent;
--color-bg: #ff47479c; --color-bg: #ff47479c;
--color-light: #ef44441a; --color-light: #ef44441a;
--color-extra: rgba(239, 68, 68, 0.3); --color-extra: rgba(239, 68, 68, 0.3);
@ -31,7 +31,13 @@
.markdown-body.green { .markdown-body.green {
background-color: var(--markdown-bg); background-color: var(--markdown-bg);
@apply p-3 lg:p-6; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
border-radius: 10px;
padding: 1.6em;
@media screen and (max-width: 768px) {
padding: 0;
box-shadow: none;
}
strong { strong {
&::before{ &::before{
@ -132,10 +138,9 @@
} }
} }
// 由prism.scss处理了
pre { pre {
background: var(--prism-background); background: #f7f7f7;
font-size: var(--prism-font-size); font-size: 0.95em;
// /* border: 1px solid #ddd; */ // /* border: 1px solid #ddd; */
// padding: 1em 1.5em; // padding: 1em 1.5em;
display: block; display: block;
@ -144,7 +149,7 @@
pre, pre,
pre code { pre code {
font-family: var(--prism-font-family); font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
} }
// /* 底部印刷体版本等标记 */ // /* 底部印刷体版本等标记 */
@ -195,6 +200,33 @@
margin: 0; margin: 0;
} }
} }
/* 代码块整体 */
pre {
background: #f7f7f7; /* One Dark 背景 */
color: #333; /* 文字色 */
border-radius: 10px; /* 圆角 */
padding: 1.2rem;
margin: 1rem 0;
overflow-x: auto; /* 长代码横向滚动 */
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
font-size: 0.95em;
line-height: 1.5;
}
/* 行内代码 `code` */
code {
background: #f0f0f0;
color: #d73a49;
padding: 2px 6px;
border-radius: 4px;
}
pre code {
background: transparent;
padding: 0;
color: inherit;
}
table { table {
width: 100%; width: 100%;
display: table; display: table;

4
app/pages/me/posts/[id].vue

@ -149,9 +149,9 @@ const shareUrl = computed(() => {
<UButton to="/me/posts" variant="ghost" color="neutral" size="sm"> <UButton to="/me/posts" variant="ghost" color="neutral" size="sm">
返回列表 返回列表
</UButton> </UButton>
<UButton type="submit" form="edit-post-form" :loading="saving" size="sm"> <!-- <UButton type="submit" form="edit-post-form" :loading="saving" size="sm">
保存文章 保存文章
</UButton> </UButton> -->
</div> </div>
</div> </div>

4
app/pages/me/posts/new.vue

@ -83,9 +83,9 @@ async function submit() {
<UButton to="/me/posts" variant="ghost" color="neutral"> <UButton to="/me/posts" variant="ghost" color="neutral">
返回列表 返回列表
</UButton> </UButton>
<UButton type="submit" form="new-post-form" :loading="loading"> <!-- <UButton type="submit" form="new-post-form" :loading="loading">
创建文章 创建文章
</UButton> </UButton> -->
</div> </div>
</div> </div>

BIN
packages/drizzle-pkg/db.sqlite

Binary file not shown.
Loading…
Cancel
Save