Skip to content

Commit

Permalink
Add new styles to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Dec 10, 2023
1 parent ecc89d2 commit 134f64e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/components/StaticSites/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rehypeKatex from 'rehype-katex'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'

import {H1, H2, H3, Li, MarkdownLink, P, Table, Td, Th} from './Texts'
import {H1, H2, H3, Li, MarkdownLink, Ol, P, Table, Td, Th} from './Texts'

type MarkdownProps = {
content: string
Expand All @@ -25,6 +25,7 @@ export const Markdown: FC<MarkdownProps> = ({content}) => (
h1: H1,
h2: H2,
h3: H3,
ol: Ol,
li: Li,
}}
>
Expand Down
5 changes: 1 addition & 4 deletions src/components/StaticSites/Texts.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
text-align: center;
}

.th, .td {
padding: 3px 1.5vw;
}

.th {
padding: 3px 1.5vw;
background-color: black;
color: white;
}
1 change: 0 additions & 1 deletion src/components/StaticSites/Texts.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export type Styles = {
table: string
td: string
th: string
}

Expand Down
21 changes: 13 additions & 8 deletions src/components/StaticSites/Texts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {FC, ReactNode} from 'react'
import {
HeadingProps,
LiProps,
OrderedListProps,
ReactMarkdownProps,
TableDataCellProps,
TableHeaderCellProps,
Expand Down Expand Up @@ -33,17 +34,21 @@ export const Th: FC<TableHeaderCellProps> = ({children}) => (
)

export const Td: FC<TableDataCellProps> = ({children}) => (
<td className={styles.td}>
<Typography variant="body1">{children}</Typography>
</td>
<Typography variant="body1" component="td" p={0.3}>
{children}
</Typography>
)

export const Ol: FC<OrderedListProps> = ({children}) => (
<Typography variant="body1" component="ol">
{children}
</Typography>
)

export const Li: FC<LiProps> = ({children}) => (
<li>
<Typography variant="body1" mt={1} component="div">
{children}
</Typography>
</li>
<Typography variant="body1" mt={1} component="li">
{children}
</Typography>
)

export const P: FC<ReactMarkdownProps> = ({children}) => (
Expand Down

0 comments on commit 134f64e

Please sign in to comment.