feat: add color palette.

This commit is contained in:
jaywcjlove
2022-09-06 00:06:36 +08:00
parent 8720638f9d
commit 8f62d41020
16 changed files with 232 additions and 102 deletions

View File

@@ -14,7 +14,7 @@ export const Warpper = styled.div`
`;
export const Preview = (props: MarkdownPreviewProps) => {
const { css } = useContext(Context);
const html = markdownToHTML(props.source || '', css);
const { css, preColor, previewTheme } = useContext(Context);
const html = markdownToHTML(props.source || '', css, { preColor, previewTheme });
return <Warpper contentEditable spellCheck={false} dangerouslySetInnerHTML={{ __html: html }} />;
};