Setting background color overwrites the textarea font color

Aperta
#701 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hiyouwhatsapp ci sta già lavorando.

Dal 29/10/2026.

  • #721 di @hiyouwhatsapp — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
css, react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con la riproduzione CodeSandbox collegata e ispeziona gli stili dell’editor attorno a .w-md-editor-text-pre > code e .w-md-editor-text-input. Conferma che l’impostazione di background-color modifica il colore del carattere renderizzato, quindi verifica che la correzione minima preservi un color configurato indipendentemente; le proprietà dell’editor richieste costituiscono un ambito più ampio opzionale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
2.9k
Fork
200
Merge medio
6h 38m
PR unite (30g)
16

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uiwjs/react-md-editor

Tutte le issue di uiwjs/react-md-editor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.