diff --git a/src/components/Rendering/Code.js b/src/components/Rendering/Code.js index 759a9e4..60d323d 100644 --- a/src/components/Rendering/Code.js +++ b/src/components/Rendering/Code.js @@ -1,14 +1,16 @@ import SyntaxHighlighter from 'react-syntax-highlighter' -import {monokai} from "react-syntax-highlighter/dist/cjs/styles/hljs"; import stripTabs from "../../utils/stripTabs"; import {useContext} from "preact/hooks"; import CodeDefaultLanguage from "../../contexts/CodeDefaultLanguage"; +import CodeDefaultStyle from "../../contexts/CodeDefaultStyle"; export default function(props) { const language = useContext(CodeDefaultLanguage) + const style = useContext(CodeDefaultStyle) return ( - + {stripTabs(String(props.children))} ) diff --git a/src/contexts/CodeDefaultStyle.js b/src/contexts/CodeDefaultStyle.js new file mode 100644 index 0000000..210db47 --- /dev/null +++ b/src/contexts/CodeDefaultStyle.js @@ -0,0 +1,4 @@ +import {createContext} from "preact"; +import {tomorrowNightBlue} from "react-syntax-highlighter/dist/cjs/styles/hljs"; + +export default createContext(tomorrowNightBlue);