Setting background color overwrites the textarea font color

オープン
#701 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@hiyouwhatsapp がすでに取り組んでいます。

2026年10月29日 から。

  • #721 @hiyouwhatsapp による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
css, react, typescript
領域
frontend

調査の方向性

リンクされたCodeSandboxの再現を起点に、.w-md-editor-text-pre > code と .w-md-editor-text-input 周辺のエディターのスタイルを調査します。background-color を設定するとレンダリングされたフォントの色が変わることを確認し、続けて最小限の修正によって独立して設定された color が維持されることを検証します。要求されているエディターのプロパティは、任意のより広いスコープです。

索引モデルが issue の本文から書いたものです。

説明

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 (https://github.com/uiwjs/react-md-editor/issues/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.

主要言語
TypeScript
スター
2.9k
フォーク
200
平均マージ
6時間 38分
マージ済み PR(30日)
16

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uiwjs/react-md-editor のほかの issue

uiwjs/react-md-editor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。