Skip to content

Commit

Permalink
💄 [#1924] tinymce with dark skin
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Oct 17, 2022
1 parent 581ddc0 commit 1b96394
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/openforms/js/components/admin/form_design/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ const TinyMCEEditor = ({content, onEditorChange}) => {
const editorRef = useRef(null);
const tinyMceUrl = useContext(TinyMceContext);
const intl = useIntl();
const useDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;

return (
<>
<Editor
tinymceScriptSrc={tinyMceUrl}
onInit={(evt, editor) => (editorRef.current = editor)}
value={content}
init={{...tinyMceConfig, language: intl.locale}}
init={{
...tinyMceConfig,
language: intl.locale,
skin: useDarkMode ? 'oxide-dark' : 'oxide',
content_css: useDarkMode ? 'dark' : 'default',
}}
onEditorChange={onEditorChange}
/>
</>
Expand Down

0 comments on commit 1b96394

Please sign in to comment.