From 3bf313ffc360ea3ffda9be709bc19f394e145ea9 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sat, 3 Sep 2022 13:33:25 +0800 Subject: [PATCH] style: modify theme style. --- src/components/Layout.tsx | 1 + src/pages/home/Preview.tsx | 2 +- src/pages/theme/Preview.tsx | 2 +- src/themes/base.md.css | 14 +++++++++++++- src/themes/default.md.css | 33 +++++++++++++++------------------ src/themes/simple.md.css | 25 +++++++++++-------------- src/themes/underscore.md.css | 27 ++++++++++++--------------- 7 files changed, 54 insertions(+), 50 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 1259c03..80af169 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -51,6 +51,7 @@ const Section = styled.section` font-size: 1.05rem; display: block; line-height: 12px; + margin-left: 0.6rem; } a svg { display: block; diff --git a/src/pages/home/Preview.tsx b/src/pages/home/Preview.tsx index b391538..6dc01aa 100644 --- a/src/pages/home/Preview.tsx +++ b/src/pages/home/Preview.tsx @@ -15,5 +15,5 @@ const Warpper = styled.div` export const Preview = (props: MarkdownPreviewProps) => { const { css } = useContext(Context); const html = markdownToHTML(props.source || '', css); - return ; + return ; }; diff --git a/src/pages/theme/Preview.tsx b/src/pages/theme/Preview.tsx index 574e79d..0d5e8fa 100644 --- a/src/pages/theme/Preview.tsx +++ b/src/pages/theme/Preview.tsx @@ -15,5 +15,5 @@ const Warpper = styled.div` export const Preview = (props: MarkdownPreviewProps) => { const { css, markdown } = useContext(Context); const html = markdownToHTML(markdown, css); - return ; + return ; }; diff --git a/src/themes/base.md.css b/src/themes/base.md.css index 52522b1..48a5beb 100644 --- a/src/themes/base.md.css +++ b/src/themes/base.md.css @@ -6,16 +6,28 @@ a { h1 { color: inherit; font-size: 1.5rem; + font-weight: bold; } h2 { color: inherit; margin: 2.5rem 0 1rem 0; + font-size: 1.3em; + font-weight: bold; } h3 { color: inherit; - margin: 2rem 0 1rem 0; + margin: 1em 0 1em 0; + font-weight: bold; + font-size: 1em; +} + +h4 { + color: inherit; + margin: 0.6em 0 0.6em 0; + font-weight: bold; + font-size: 0.9em; } p { diff --git a/src/themes/default.md.css b/src/themes/default.md.css index 7a64cce..4f2c39d 100644 --- a/src/themes/default.md.css +++ b/src/themes/default.md.css @@ -1,7 +1,7 @@ a { color: #576b95; text-decoration: none; - font-size: 14px; + font-size: 0.85em; } h1 { @@ -11,7 +11,7 @@ h1 { line-height: 1.75; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 1.2em; + font-size: 1em; font-weight: bold; margin: 2em auto 1em; padding: 0 1em; @@ -26,16 +26,16 @@ h2 { line-height: 1.75; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 1.2em; + font-size: 1.3em; font-weight: bold; margin: 4em auto 2em; padding: 0 0.3em; - border-radius: 0.3rem; + border-radius: 0.3em; background: #009874; } p { - font-size: 14px; + font-size: 0.85em; } h3 { @@ -53,19 +53,17 @@ h3 { ul { padding-left: 1.2em; - font-size: 14px; } ol { padding-left: 1.2em; - font-size: 14px; } li { margin: 0; - line-height: 26px; + line-height: 1.5em; color: rgb(30 41 59); - font-size: 14px; + font-size: 0.85em; } blockquote { @@ -73,7 +71,7 @@ blockquote { line-height: 1.75; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 14px; + font-size: 0.85em; font-style: normal; border-left: none; padding: 0.1rem 1rem; @@ -88,7 +86,6 @@ pre { padding: 1em; color: rgb(51, 51, 51); background: rgb(248, 248, 248); - font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; @@ -114,7 +111,7 @@ table { width: 100% !important; border-collapse: collapse; line-height: 1.35; - font-size: 90%; + font-size: 0.85em; } td { @@ -132,7 +129,7 @@ th { text-align: left; line-height: 1.75; font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace; - font-size: 14px; + font-size: 0.85em; margin: 0px; white-space: nowrap; } @@ -148,20 +145,20 @@ th { white-space: pre; color: #009874; background: rgba(27, 31, 35, 0.05); - padding: 0.2rem 0.3rem; + padding: 0.2em 0.3em; border-radius: 4px; font-weight: bold; - font-size: 14px; + font-size: 0.85em; } .footnotes-title { display: table; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 1rem; + font-size: 1em; font-weight: bold; - margin: 3rem 0 0.6rem 0; - padding-left: 0.2rem; + margin: 3em 0 0.6em 0; + padding-left: 0.2em; } .footnotes-list { diff --git a/src/themes/simple.md.css b/src/themes/simple.md.css index 74b8764..006a65c 100644 --- a/src/themes/simple.md.css +++ b/src/themes/simple.md.css @@ -1,7 +1,7 @@ a { color: #576b95; text-decoration: none; - font-size: 14px; + font-size: 0.85em; } h1 { @@ -35,7 +35,7 @@ h2 { } p { - font-size: 14px; + font-size: 0.85em; } h3 { @@ -53,19 +53,17 @@ h3 { ul { padding-left: 1.2em; - font-size: 14px; } ol { padding-left: 1.2em; - font-size: 14px; } li { margin: 0; - line-height: 26px; + line-height: 1.5em; color: rgb(30 41 59); - font-size: 14px; + font-size: 0.85em; } blockquote { @@ -73,7 +71,7 @@ blockquote { line-height: 1.75; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 14px; + font-size: 0.85em; font-style: normal; border-left: none; padding: 0.1rem 1rem; @@ -88,7 +86,6 @@ pre { padding: 1em; color: rgb(51, 51, 51); background: rgb(248, 248, 248); - font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; @@ -114,7 +111,7 @@ table { width: 100% !important; border-collapse: collapse; line-height: 1.35; - font-size: 90%; + font-size: 0.85em; } td { @@ -132,7 +129,7 @@ th { text-align: left; line-height: 1.75; font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace; - font-size: 14px; + font-size: 0.85em; margin: 0px; white-space: nowrap; } @@ -151,17 +148,17 @@ th { padding: 0.2rem 0.3rem; border-radius: 4px; font-weight: bold; - font-size: 14px; + font-size: 0.85em; } .footnotes-title { display: table; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 1rem; + font-size: 1em; font-weight: bold; - margin: 3rem 0 0.6rem 0; - padding-left: 0.2rem; + margin: 3em 0 0.6em 0; + padding-left: 0.2em; } .footnotes-list { diff --git a/src/themes/underscore.md.css b/src/themes/underscore.md.css index 5135a6f..f7d3a17 100644 --- a/src/themes/underscore.md.css +++ b/src/themes/underscore.md.css @@ -1,7 +1,7 @@ a { color: #576b95; text-decoration: none; - font-size: 14px; + font-size: 0.85em; } h1 { @@ -32,7 +32,7 @@ h2 { } p { - font-size: 14px; + font-size: 0.85em; } h3 { @@ -50,19 +50,17 @@ h3 { ul { padding-left: 1.2em; - font-size: 14px; } ol { padding-left: 1.2em; - font-size: 14px; } li { margin: 0; - line-height: 26px; + line-height: 1.5em; color: rgb(30 41 59); - font-size: 14px; + font-size: 0.85em; } blockquote { @@ -70,7 +68,7 @@ blockquote { line-height: 1.75; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 14px; + font-size: 0.85em; font-style: normal; border-left: none; padding: 0.1rem 1rem; @@ -85,7 +83,6 @@ pre { padding: 1em; color: rgb(51, 51, 51); background: rgb(248, 248, 248); - font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; @@ -111,7 +108,7 @@ table { width: 100% !important; border-collapse: collapse; line-height: 1.35; - font-size: 90%; + font-size: 0.85em; } td { @@ -129,7 +126,7 @@ th { text-align: left; line-height: 1.75; font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace; - font-size: 14px; + font-size: 0.85em; margin: 0px; white-space: nowrap; } @@ -145,20 +142,20 @@ th { white-space: pre; color: #ffb11b; background: rgba(27, 31, 35, 0.05); - padding: 0.2rem 0.3rem; + padding: 0.2em 0.3em; border-radius: 4px; font-weight: bold; - font-size: 14px; + font-size: 0.85em; } .footnotes-title { display: table; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; - font-size: 1rem; + font-size: 1em; font-weight: bold; - margin: 3rem 0 0.6rem 0; - padding-left: 0.2rem; + margin: 3em 0 0.6em 0; + padding-left: 0.2em; } .footnotes-list {