Skip to content

Commit

Permalink
style: fix custom css
Browse files Browse the repository at this point in the history
修复样式错误
  • Loading branch information
yanglbme committed Dec 18, 2019
1 parent 93c0bb8 commit 77506f9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 34 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章
- [x] 支持色盘取色,并一键替换颜色
- [x] 支持链接微信图文,外链自动转为文末索引
- [x] 支持一键复制并粘贴到公众号后台
- [x] 支持图片上传并将 URL 插入编辑器光标定位处
- [x] 支持多图上传并将 URL 插入编辑器光标定位处
- [x] 支持自定义 CSS 样式并实时渲染
- [x] 支持一键恢复至默认内容及样式
- [x] 支持打开或关闭引用链接的选项
Expand All @@ -42,6 +42,7 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章

## 示例文章
- [ES6 特性快速扫盲](https://mp.weixin.qq.com/s/I3EzOO0skf8xDCGtyYM5Lg)
- [免费且好用的图床,就你了,「图壳」!](https://mp.weixin.qq.com/s/0HhgHLo_tTRFZcC-CVjDbw)
- [GitHub 项目持续本地化,交给它来做,准没错!](https://mp.weixin.qq.com/s/KO4xHr4EI0YfjF0hiT3pbw)
- [阿里又一个 20k+ stars 开源项目诞生,恭喜 fastjson!](https://mp.weixin.qq.com/s/RNKDCK2KoyeuMeEs6GUrow)
- [全球最大的成人网站 Pornhub 2019 年度报告新鲜出炉!](https://mp.weixin.qq.com/s/LY5kOzof1h3I0bw7tCkV1Q)
Expand Down
44 changes: 19 additions & 25 deletions assets/scripts/themes/default-theme-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,40 @@ const DEFAULT_CSS_CONTENT =
`/*
按Ctrl+F可格式化
*/
/* 一级标题 */
/* 一级标题样式 */
h1 {
}
/* 二级标题 */
/* 二级标题样式 */
h2 {
}
/* 三级标题 */
/* 三级标题样式 */
h3 {
}
h4{
/* 四级标题样式 */
h4 {
}
/* 段落 */
p {
/* 图片样式 */
image {
}
/* 引用样式 */
blockquote {
}
/* 引用段落样式 */
blockquote_p {
}
code {
}
image {
}
image_org{
}
/* 无序列表 */
ol {
}
ul {
}
/* 引用 */
blockquote {
}
/* 行内样式 */
table {
/* 段落样式 */
p {
}
thead {
/* 行内代码样式 */
codespan {
}
/* 粗体样式 */
strong {
}
/* 脚注文字 */
footnote {
/* 链接样式 */
link {
}
/* 微信链接样式 */
wx_link {
}
`
9 changes: 1 addition & 8 deletions assets/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,11 @@ function customCssWithTemplate(jsonString, color) {
custom_theme.block.p = Object.assign(custom_theme.block.p, jsonString.p);
custom_theme.block.blockquote = Object.assign(custom_theme.block.blockquote, jsonString.blockquote);
custom_theme.block.blockquote_p = Object.assign(custom_theme.block.blockquote_p, jsonString.blockquote_p);
custom_theme.block.code = Object.assign(custom_theme.block.code, jsonString.code);
custom_theme.block.image = Object.assign(custom_theme.block.image, jsonString.image);
custom_theme.block.ol = Object.assign(custom_theme.block.ol, jsonString.ol);
custom_theme.block.ul = Object.assign(custom_theme.block.ul, jsonString.ul);
custom_theme.block.footnotes = Object.assign(custom_theme.block.footnotes, jsonString.footnotes);
custom_theme.block.figure = Object.assign(custom_theme.block.figure, jsonString.figure);

// inline
custom_theme.inline.strong = Object.assign(custom_theme.inline.strong, jsonString.strong);
custom_theme.inline.table = Object.assign(custom_theme.inline.table, jsonString.table);
custom_theme.inline.thead = Object.assign(custom_theme.inline.thead, jsonString.thead);
custom_theme.inline.strong = Object.assign(custom_theme.inline.strong, jsonString.strong);
custom_theme.inline.codespan = Object.assign(custom_theme.inline.codespan, jsonString.codespan);
custom_theme.inline.link = Object.assign(custom_theme.inline.link, jsonString.link);
custom_theme.inline.wx_link = Object.assign(custom_theme.inline.wx_link, jsonString.wx_link);

Expand Down

0 comments on commit 77506f9

Please sign in to comment.