File tree Expand file tree Collapse file tree 2 files changed +56
-2
lines changed
src/components/ViewMarkdown Expand file tree Collapse file tree 2 files changed +56
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,22 @@ const ViewMarkdown: React.FC<ViewMarkdownProps> = ({ content }) => {
8484 th : S . Th ,
8585 td : S . Td ,
8686 em : S . Em ,
87+ h2 : S . H2 ,
88+ h3 : S . H3 ,
89+ h4 : S . Default ,
90+ h5 : S . Default ,
91+ h6 : S . Default ,
8792 code : ( { node, className, children, ...props } ) => {
93+ const isInline = ! node ?. properties ?. className ;
94+
95+ if ( isInline ) {
96+ return (
97+ < S . Code className = { className } { ...props } >
98+ { children }
99+ </ S . Code >
100+ ) ;
101+ }
102+
88103 return (
89104 < CodeBlock className = { className } { ...props } node = { node } >
90105 { children }
Original file line number Diff line number Diff line change @@ -6,12 +6,37 @@ const defaultStyle = css`
66 word-wrap: break-word;
77 /* overflow-x: scroll;
88 white-space: pre-wrap; */
9+ font-size: 1rem;
10+ ` ;
11+
12+ const headingStyle = css `
13+ font-weight: 600;
14+ font-family: "Love Ya Like A Sister", cursive;
15+ margin: 10px 0;
916` ;
1017
1118export const H1 = styled . h1 `
1219 ${ defaultStyle }
13- font-size: 1rem;
14- font-weight: 600;
20+ ${ headingStyle }
21+ font-size: 1.4rem;
22+ ` ;
23+
24+ export const H2 = styled . h2 `
25+ ${ defaultStyle }
26+ ${ headingStyle }
27+ font-size: 1.3rem;
28+ ` ;
29+
30+ export const H3 = styled . h3 `
31+ ${ defaultStyle }
32+ ${ headingStyle }
33+ font-size: 1.2rem;
34+ ` ;
35+
36+ export const Default = styled . h4 `
37+ ${ defaultStyle }
38+ ${ headingStyle }
39+ font-size: 1.1rem;
1540` ;
1641
1742export const Break = styled . br `
@@ -20,6 +45,7 @@ export const Break = styled.br`
2045
2146export const P = styled . p `
2247 ${ defaultStyle }
48+ margin: 2px 0;
2349` ;
2450
2551export const Div = styled . div `
@@ -187,3 +213,16 @@ export const Input = styled.input`
187213 &:checked {
188214 }
189215` ;
216+
217+ export const strong = styled . strong `
218+ ${ defaultStyle }
219+ font-weight: bold;
220+ ` ;
221+
222+ export const Code = styled . code `
223+ ${ defaultStyle }
224+ background-color: #282a36;
225+ border-radius: 4px;
226+ padding: 2px 6px;
227+ font-size: 0.9rem;
228+ ` ;
You can’t perform that action at this time.
0 commit comments