Skip to content

Commit

Permalink
feat: add a new post content styles (#132)
Browse files Browse the repository at this point in the history
添加新的内容渲染样式。https://github.com/sindresorhus/github-markdown-css

<img width="1031" alt="图片" src="https://github.com/halo-dev/theme-earth/assets/21301288/a9a59389-3fd9-4675-861c-54d5021391ac">

Fixes #42

/kind feature

```release-note
添加新的内容渲染样式
```
  • Loading branch information
ruibaby authored Jan 2, 2024
1 parent 6a26a55 commit 3008666
Show file tree
Hide file tree
Showing 6 changed files with 1,289 additions and 7 deletions.
9 changes: 9 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ spec:
- group: post
label: 文章
formSchema:
- $formkit: select
name: content_style
label: 内容样式
value: "tailwind"
options:
- label: GitHub 风格
value: github
- label: Tailwind CSS Typography
value: tailwind
- $formkit: repeater
name: share_items
label: 分享按钮
Expand Down
43 changes: 43 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,46 @@ body {
@apply rounded bg-gray-100 px-1 py-0.5 text-sm text-gray-900 hover:bg-gray-200 dark:bg-slate-600 dark:text-slate-50 dark:hover:bg-slate-700 dark:hover:text-slate-100;
}
}

.markdown-body {
line-height: 1.75;

ul {
list-style: disc;
}

ol {
list-style: decimal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
border: none !important;
}

pre {
padding: 0 !important;

code {
border: 1px solid #fbf6f6;
}
}

p > img {
border-radius: 0.4rem;
overflow: hidden;
@apply shadow;
}

:not(pre) > code {
background-color: #afb8c133;
}
}

.tailwind-typography {
@apply prose prose-base mt-4 dark:prose-invert prose-pre:p-0;
}
2 changes: 1 addition & 1 deletion templates/assets/dist/style.css

Large diffs are not rendered by default.

Loading

0 comments on commit 3008666

Please sign in to comment.