thepieterdc / dodona-plugin-vscode

Plugin for Visual Studio Code to submit exercises to Dodona.
MIT License
5 stars 5 forks source link

[FEATURE] Dark mode setting for content pages #55

Open BTWS2 opened 4 years ago

BTWS2 commented 4 years ago

Is it possible to have the same dark mode as the Dodona website for activity descriptions and reading activities?

Dark mode can be a toggle in the settings, but shouldn't be the default.

VS Code: image

Dodona webpage: image

stijndcl commented 4 years ago

I think the default colorscheme depends on your OS theme, as my reading activities & descriptions are already in dark mode (even when using a VSC light theme).

I'm not sure if it's possible to do set a custom theme for a specific window & have it dynamically change via code, but I'll check the docs, I expect it to have support somewhere.

EDIT: Quote from the VSC docs:

By default, the theme is stored in your user settings and applies globally to all workspaces. You can also configure a workspace specific theme. To do so, set a theme in the Workspace settings.

Seems like it should already be following your VSC theme, so it's rather strange that it doesn't. It does seem to have API support though so I'll look into this tomorrow.

image

BTWS2 commented 4 years ago

I didn't express myself well. I was referring to this feature on the Dodona website: image

This changes the content to dark mode (I don't mean the color scheme of VS code itself). In my screenshot the VS Code IDE is in dark mode, but the activity description or reading activities are not in dark mode. It would be nice if the extension had a similar feature to change the content to dark mode. I think it's same content with a different css file. image

You're right, the content changes to dark mode if you enable it in the OS: image

This is the desired result, but without having to enable it in the OS, but with a toggle in the extension settings (just like on dodona.ugent.be). The VS Code color theme and mode (light/dark) of the content are independent and the user can choose both. image

stijndcl commented 4 years ago

The VS Code color theme and mode (light/dark) of the content are independent and the user can choose both.

That indeed makes more sense. In case it has API support it should be doable then.

BTWS2 commented 4 years ago

I found this on https://code.visualstudio.com/docs/getstarted/settings

// If set, automatically switch to the preferred color theme based on the OS appearance.
"window.autoDetectColorScheme": false,

A similar setting should be somehow overridden with dark/light depending on the toggle in the extension settings.

Edit: https://code.visualstudio.com/api/references/vscode-api#window

BTWS2 commented 4 years ago

Current scenario:

Proposed scenario:

Maybe this is helpful? https://stackoverflow.com/questions/37257911/detect-light-dark-theme-programmatically-in-visual-studio-code