From 8285b4ba57e94468dbc788a6b07a4e7266d332be Mon Sep 17 00:00:00 2001 From: developomp Date: Mon, 24 Jan 2022 10:05:05 +0900 Subject: [PATCH] improved header styling --- source/markdown/posts/test post.md | 30 ++++++++++++++++++++++++++---- source/src/styles/globalStyle.tsx | 27 +++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/source/markdown/posts/test post.md b/source/markdown/posts/test post.md index 0bd596d..1123d02 100644 --- a/source/markdown/posts/test post.md +++ b/source/markdown/posts/test post.md @@ -7,8 +7,7 @@ tags: -This post exists to test various features such as markdown-to-html conversion.
-A post have title, post date, tags, and content. +This post exists to test various features such as markdown-to-html conversion, table of contents generation, and metadata parsing.
## Link @@ -76,7 +75,7 @@ print(z is w) # False. id(z) is not equal to id(w) # All integers between -5 and 256 share the same id. ``` -## Etc +## Text styling > blockquote > @@ -90,7 +89,7 @@ _italic_
this is a ^superscript^ (soon^TM^)
and this is a ~subscript~ (H~2~O) -## Styling +## CSS styling

centered paragraph @@ -122,3 +121,26 @@ $$ [^css_bad]: Based on my experience building this website, Dec 2021. [^python_is_overrated]: Based on my infinite wisdom, Dec 2021. + +## headers + +Headers have different size and indentation depending on their level. + +- Post title: `h1` +- this section: `h2` + +### h3 + +Lorem ipsum blah blah. + +#### h4 + +Lorem ipsum blah blah. + +##### h5 + +Lorem ipsum blah blah. + +###### h6 + +Lorem ipsum blah blah. diff --git a/source/src/styles/globalStyle.tsx b/source/src/styles/globalStyle.tsx index 7010f6e..345b243 100644 --- a/source/src/styles/globalStyle.tsx +++ b/source/src/styles/globalStyle.tsx @@ -212,15 +212,38 @@ const hrCSS = css` const headerCSS = css` /* intentionally left out h1 */ - h2, h3, h4, h5, h6 { - margin-top: -3rem; + margin-top: -2rem; + margin-bottom: 0.5rem; font-weight: 700; } + + h1 { + font-size: 2.5rem; + } + h2 { + font-size: 1.5rem; + } + h3 { + font-size: 1rem; + text-indent: 0.5rem; + } + h4 { + font-size: 1rem; + text-indent: 1rem; + } + h5 { + font-size: 1rem; + text-indent: 1.5rem; + } + h6 { + font-size: 1rem; + text-indent: 2rem; + } ` const markCSS = css`