client: improve markdown styles
This commit is contained in:
parent
eaffebb53c
commit
30e32e33cf
4 changed files with 3 additions and 15 deletions
|
@ -47,7 +47,7 @@ const MarkdownPreview = ({ height = 500, fileId, content, title }: Props) => {
|
||||||
fetchPost()
|
fetchPost()
|
||||||
}, [content, fileId, title])
|
}, [content, fileId, title])
|
||||||
return (<>
|
return (<>
|
||||||
{isLoading ? <div>Loading...</div> : <div data-theme={theme} className={styles.markdownPreview} dangerouslySetInnerHTML={{ __html: preview }} style={{
|
{isLoading ? <div>Loading...</div> : <article data-theme={theme} className={styles.markdownPreview} dangerouslySetInnerHTML={{ __html: preview }} style={{
|
||||||
height
|
height
|
||||||
}} />}
|
}} />}
|
||||||
</>)
|
</>)
|
||||||
|
|
|
@ -75,19 +75,10 @@
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdownPreview ul ul {
|
|
||||||
list-style: circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.markdownPreview ul ul li {
|
|
||||||
margin-left: var(--gap);
|
|
||||||
}
|
|
||||||
|
|
||||||
.markdownPreview code {
|
.markdownPreview code {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
padding: 2px 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdownPreview code::before,
|
.markdownPreview code::before,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import Highlight, { defaultProps, Language } from 'prism-react-renderer'
|
import Highlight, { defaultProps, Language, } from 'prism-react-renderer'
|
||||||
import { renderToStaticMarkup } from 'react-dom/server'
|
import { renderToStaticMarkup } from 'react-dom/server'
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
delete defaultProps.theme
|
delete defaultProps.theme
|
||||||
// import linkStyles from '../components/link/link.module.css'
|
// import linkStyles from '../components/link/link.module.css'
|
||||||
|
|
|
@ -8,10 +8,6 @@ article > * + * {
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
article p {
|
|
||||||
color: var(--article-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
article img {
|
article img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
/* width: var(--main-content); */
|
/* width: var(--main-content); */
|
||||||
|
|
Loading…
Reference in a new issue