-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dark mode on fly #1618
Comments
Current workaround is const toggleDarkMode=()=>{
let el = document.getElementsByClassName("toastui-editor-defaultUI")[0];
if(el.classList.contains("toastui-editor-dark"))
el.classList.remove("toastui-editor-dark");
else el.classList.add("toastui-editor-dark");
} It's working perfectly, but still if there is any other way then let me know. |
@ats1999 |
Hi, I have a use case for this too, would love to see it added to the API :) |
The other work around is that you can just add the class to the wrapper dom. Seem like it always overwrite the default. I would love to have direct API for this though. <div className={`editor-panel-editor${theme == 'dark' ? ' toastui-editor-dark': ''}`}>
<Editor
ref={editorRef}
initialValue={content}
previewStyle="vertical"
height="600px"
initialEditType="markdown"
useCommandShortcut={true}
plugins={[[codeSyntaxHighlight, { highlighter: Prism }]]}
/>
</div> |
both of them would work and wait for this feature to be inbuilt. |
Would love to see this feature too! |
I would like a vote for this feature as well, for what it's worth. 🙏 |
Summary
I want to change dark mode of the editor when user clicks on the button.
Screenshots
In the above picture, you can see i have added a dark mode button. I want to change mode from light to dark and dark to light when user click on the button.
Version
latest
Additional context
I am using ReactJS.
When user click on the button then
toggleDarkMode
function will be executed. Although,theme
state variable is changeing, but UI is not updating.live
https://codesandbox.io/s/still-night-0feor?file=/src/App.js
The text was updated successfully, but these errors were encountered: