Conversation
|
@tillig... Just for my clarification, this fix will let us work in dark mode in VS Code, but the ReDoc preview will display with the standard white background, right? If so, this 100% works for me. Really appreciate you doing the work for this! |
Author
|
@Vernholio Correct. Regardless of the OS or VS Code display mode, ReDoc will only ever display in light mode with this fix because that's the only mode it currently supports. A future PR could update to ReDoc 3 when it's available, which does support a true dark mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #356.
The webview shell adds
dark-modefor both previews, but only the SwaggerUI stylesheet has rules for it — ReDoc keeps drawing its light theme text colors, which vanish against the dark background. This limits the class, and the dark body background with it, to the SwaggerUI preview.Switching ReDoc to a dark theme instead isn't an option yet: it has no dark mode of its own (Redocly/redoc#2673), and darkening 2.x means hand-writing a theme object that Redoc 3 replaces with CSS design tokens. A light preview under a dark editor theme seemed the better place to sit until that upgrade.
shouldUseDarkModeis covered for both renderers across all four theme kinds; the test fails against the current logic and passes with the change. Also checked by hand in a dark theme.