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

json view doesn't support dark mode #34

Open
jaked opened this issue May 28, 2024 · 1 comment
Open

json view doesn't support dark mode #34

jaked opened this issue May 28, 2024 · 1 comment

Comments

@jaked
Copy link
Collaborator

jaked commented May 28, 2024

JSON output is rendered using react-json-view, and the default theme is unreadable in dark mode. Not sure if react-json-view supports dark mode or if there's a way to check the color mode from a VS Code renderer.

@jaked
Copy link
Collaborator Author

jaked commented Jun 4, 2024

this seems doable but it needs some plumbing:

we can track the color theme from the extension with

		/**
		 * The currently active color theme as configured in the settings. The active
		 * theme can be changed via the `workbench.colorTheme` setting.
		 */
		export let activeColorTheme: ColorTheme;

		/**
		 * An {@link Event} which fires when the active color theme is changed or has changes.
		 */
		export const onDidChangeActiveColorTheme: Event<ColorTheme>;

then check for dark mode with

	/**
	 * Represents a color theme.
	 */
	export interface ColorTheme {

		/**
		 * The kind of this color theme: light, dark, high contrast dark and high contrast light.
		 */
		readonly kind: ColorThemeKind;
	}

the current mode needs to be communicated to the notebook renderer and the output pane webview via message passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant