Skip to content

Commit

Permalink
Add style to <p> in Markdown component
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Nov 16, 2023
1 parent 97a7074 commit 9509110
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
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 {MarkdownLink, Table, Td, Th} from './Texts'
import {MarkdownLink, P, Table, Td, Th} from './Texts'

type MarkdownProps = {
content: string
Expand All @@ -21,6 +21,7 @@ export const Markdown: FC<MarkdownProps> = ({content}) => (
td: Td,
a: MarkdownLink,
table: Table,
p: P,
}}
>
{content}
Expand Down
4 changes: 4 additions & 0 deletions src/components/StaticSites/Texts.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
font-weight: bold;
font-style: italic;
text-transform: uppercase;
}

.p {
padding-bottom: 1rem;
}
1 change: 1 addition & 0 deletions src/components/StaticSites/Texts.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type Styles = {
p: string
table: string
td: string
th: string
Expand Down
1 change: 1 addition & 0 deletions src/components/StaticSites/Texts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export const MarkdownLink: FC<MarkdownLinkProps> = ({children, href}) => <Link h
export const Th: FC<TableHeaderCellProps> = ({children}) => <th className={styles.th}>{children}</th>
export const Td: FC<TableDataCellProps> = ({children}) => <td className={styles.td}>{children}</td>
export const Table: FC<ReactMarkdownProps> = ({children}) => <table className={styles.table}>{children}</table>
export const P: FC<ReactMarkdownProps> = ({children}) => <p className={styles.p}>{children}</p>

0 comments on commit 9509110

Please sign in to comment.