Skip to content

Setting background color overwrites the textarea font color #701

@hroger1030

Description

@hroger1030

Awesome tool, I grabbed the latest version and added it to my project. Only problem I encountered was adding some really basic styles to the editor.

The problem is
When I set a background color for the editor, the font color is changed to match the background color.

Tested on latest version of chrome.

In doing some research I found this issue that was logged back in 2022:
Editor Font #425 (#425)

I used the code sandbox that was set up with the work around there to repo problem and verify that I wasn't picking up some stray CSS.

https://codesandbox.io/embed/markdown-editor-for-react-uiwjs-react-md-editor-issues-425-2epmgh?fontsize=14&hidenavigation=1&theme=dark

I change the css in the example to the following:

.w-md-editor-text-pre > code,
.w-md-editor-text-input {
color: #000000;
background-color: #fffaf0;
}

If you remove the background color setting, everything renders fine. If you highlight the textarea you can see the text, so it is there.

The requested fix
Minimal fix would be to get the background-color property to not alter color property

Bonus points if you can get the color and background-color wired into the actual editor properties. CodeMirror might make general css styling tricky, but there are a few basic styles that users are going to be commonly set (ex: color,bg color, font, font size). Some sort of capacity for these props would be nice.

Ping me if I can help with fix, thx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions