YYsuni / react18-json-view

JSON viewer for react18
https://jv.yysuni.com/
MIT License
236 stars 15 forks source link

Dark Mode does not seem to work? #3

Closed Rietty closed 10 months ago

Rietty commented 10 months ago

Hi, I downloaded the latest version 0.2.1 and followed the guide of importing and then setting up the Dark Mode, however it fails to swap the view over/stays light colours. Is there anything else?

I import following:

import JsonView from 'react18-json-view'
import 'react18-json-view/src/style.css'
import 'react18-json-view/src/dark.css'

And use as such:

<div class="item rightpane">
<JsonView src={myFormData} collapsed={false} dark={true} />
</div>

Also wanted to say thank you so much for making this, it works fantastic and is a great help to me!

YYsuni commented 10 months ago

The dark property just helps you keep component in dark mode. To make it flexible, you only need to import the dark.css file. Then, you can set the dark class on any parent component (such as html).

You can visit the website https://jv.yysuni.com/ and learn about how it works by examining this file.

YYsuni commented 10 months ago

Don't forget to give me a star if it's helpful for you~~ 🥰😁

Rietty commented 10 months ago

The dark property just helps you keep component in dark mode. To make it flexible, you only need to import the dark.css file. Then, you can set the dark class on any parent component (such as html).

You can visit the website https://jv.yysuni.com/ and learn about how it works by examining this file.

So if I understand it, I need to set a dark-mode on my overall website/app for it to reflect in the JSON View?

YYsuni commented 10 months ago

Yes..

Rietty commented 10 months ago

Got it, thank you! (I did star project by the way!) <3