Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example values in Dark mode are hard/impossible to read #140

Open
Fox32 opened this issue Apr 29, 2021 · 5 comments
Open

Example values in Dark mode are hard/impossible to read #140

Fox32 opened this issue Apr 29, 2021 · 5 comments
Labels
p/documented t/bug Something isn't working triaged

Comments

@Fox32
Copy link

Fox32 commented Apr 29, 2021

Describe the bug

When using the dark theme, the example values are hard to read. It feels like these color values are not taken from the theme, but are hard coded.

To Reproduce

  1. Go to the storybook deployment for the dark mode: https://stoplightio.github.io/json-schema-viewer/?path=/story/jsonschemaviewer--dark
  2. Replace the background with a dark color, as it isn't set correctly
  3. Observe the example values.

Expected behavior

Example values should be styled base on the current theme.

Additional context

I'm trying to embed the json-schema-viewer into Backstage, but would like to support both light and dark mode. It's a bit difficult right now as mosaic is not public yet, but I could get it to work and understand how theming is configured 😉. I'm also aware that this is in an early state, but I'm already quite satisfied with it, nice work!

Screenshots

image

Environment (remove any that are not applicable):

  • Library version: [e.g. 3.0.0]
  • OS: [e.g. Windows 7]
  • Browser: [e.g. Chrome 61]
  • Platform: [desktop or web]
@Fox32 Fox32 added the bug Something isn't working label Apr 29, 2021
@Fox32
Copy link
Author

Fox32 commented Apr 29, 2021

The fix would probably touch https://github.com/stoplightio/json-schema-viewer/blob/beta/src/components/shared/Validations.tsx#L189, but I'm not sure which is the right color value to use here.

@raleigh04 raleigh04 added t/bug Something isn't working p/longterm triaged and removed bug Something isn't working labels May 6, 2021
@marcelltoth
Copy link
Contributor

Hey @Fox32 ! Thanks for pointing out the issue!

We'll be looking into this as soon as we enable dark mode support within our own platform. In the meanwhile if you find a way to fix it, we appreciate any pull requests.

@Fox32
Copy link
Author

Fox32 commented May 12, 2021

I think using a base color and applying it with opacity might be handy here. That way it could work with both light and dark mode.

I can't make any promises about creating a PR for it though. Right now I'm stuck at integrating the package as I run into issues with existing CSS in my app.

@marcelltoth
Copy link
Contributor

We are working on that, too.:)

@marbemac
Copy link
Contributor

Pretty sure just need to remove the hardcoded backgroundColor style (relic of v3?) https://github.com/stoplightio/json-schema-viewer/blob/beta/src/components/shared/Validations.tsx#L189 and add sl-canvas-50 class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/documented t/bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

5 participants