uiwjs / uiwjs/react-codemirror

Cannot get the same CSS color style as shown on https://uiwjs.github.io/react-codemirror/

Open
#715 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Hi, I want to get the same color CSS styling as shown on https://uiwjs.github.io/react-codemirror/ for theme: dark and language: JSON

Image

But when I tried it with react-codemirror ("@uiw/react-codemirror": "^4.23.8"):

                        <CodeMirror
                            value={{ JSON .... }}
                            minHeight={"120px"}
                            theme={basicDark}
                            extensions={[
                                basicDark,
                                javascript({ jsx: true }),
                                // EditorView.lineWrapping
                            ]}
                            onChange={onChange}
                        />

it looks like this instead:

Image

On the online example the HTML for the JSON "message": "Network Error" have seperate CSS classes for the JSON key and value:

Image

Image

But the one on my localhost both JSON key and value have the same class:

Image

Image

It seems my localhost react-codemirror is missing alot of classes and styling, why is that?

Does anyone know why this is happening?

Why is it that the outcome is different from the example shown on https://uiwjs.github.io/react-codemirror/?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodeMirror component configuration shown in the issue, especially the theme and extensions using basicDark and javascript({ jsx: true }). Compare it with the online react-codemirror example for dark-theme JSON rendering and identify why the local output differs. Done means the configuration or documentation explains the styling difference and produces the expected key and value classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.