redocusaurus icon indicating copy to clipboard operation
redocusaurus copied to clipboard

Dropdown Code block Has Contrast Issue in Dark Mode

Open Snivio opened this issue 3 years ago • 5 comments

image

In the Dark Mode Redeadin, the Text Inside the code block Becomes Difficult.

As there is no direct css selector available for the fix.

Temporary Fix: I have used the class name as I can see that it is static for that block .

[data-theme='dark'] .redocusaurus .api-content .sc-jQHtVU {
  background-color: transparent;
}

Is there any known workaround for this issue?

Thank you!

Snivio avatar Sep 12 '22 08:09 Snivio

Your temporary fix is the solution if you can make the selector not use css-in-js class names. Feel free to open a PR adding the style override here - https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc/src/theme/Redoc/styles.css

rohit-gohri avatar Sep 12 '22 09:09 rohit-gohri

I was trying to avoid the css-in-js classes but the div position seems to be dynamic and there isn't any other form of selector I can use, cant use the nth,not,has .. etc.

Snivio avatar Sep 12 '22 10:09 Snivio

The problem seems to appear from

https://github.com/rohit-gohri/redocusaurus/blob/fd611cfc37fff4cef53c8cb919c63512171467e8/packages/docusaurus-theme-redoc/src/redocData.ts#L98

This line here is causing the issue i have tried changing the color and running the redoc code seems to have fixed the issue.

The patch also fixed the below issue

image

Snivio avatar Sep 12 '22 11:09 Snivio

PR: https://github.com/rohit-gohri/redocusaurus/pull/232

Snivio avatar Sep 13 '22 10:09 Snivio

Any update on this?

Fiahblade avatar Jan 26 '23 16:01 Fiahblade