fix inconsistent text element color on dark mode while editing. (#2196)

On dark mode, while text element is being edited, it was changing color to the light mode variant (white turns back to black, etc...).

This is caused by the --appearance-filter not being applied to the floating textarea. The css var --appearance-filter is only applied to the .excalidraw class while the floating textarea is being appended to the body which put it outside of .excalidraw.

This change adds excalidraw class to the floating textarea and also adds Appearance_dark to it while dark mode is on.
This commit is contained in:
Chrisando Pramudhita 2020-10-05 21:41:57 +07:00 committed by GitHub
parent 556f9123f8
commit e424ca53c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ export const textWysiwyg = ({
editable.dataset.type = "wysiwyg"; editable.dataset.type = "wysiwyg";
// prevent line wrapping on Safari // prevent line wrapping on Safari
editable.wrap = "off"; editable.wrap = "off";
editable.className = `excalidraw ${
appState.appearance === "dark" ? "Appearance_dark" : ""
}`;
Object.assign(editable.style, { Object.assign(editable.style, {
position: "fixed", position: "fixed",