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

vscode: adjust theme #271

Merged
merged 27 commits into from
Mar 18, 2024
Merged

vscode: adjust theme #271

merged 27 commits into from
Mar 18, 2024

Conversation

danth
Copy link
Owner

@danth danth commented Mar 5, 2024

Various adjustments to the VSCode theme.

To do:

  • Make inlay hints less obnoxious
  • Improve status bar contrast
  • Improve button contrast
  • Improve contrast of selected item in popup menu
  • Fix scrollbar slider covering highlights (Finetune VSCode theme #155 (comment))
  • Fix inlay hints blending in on the current line
  • Make editor rulers less distracting
  • Fill in new options (currently set to null)
  • Fix contrast of comments in diffs
  • Fix contrast of find match highlight

We may also want to look into other uses of base06 and base07 and whether they could be replaced with something else, since these colors are rarely used in other modules.

Fixes #155

danth added 2 commits March 5, 2024 20:29
Although this makes the hints themselves more difficult to read,
it improves readability overall since you can easily skip over
the hints and see what is real code.
@danth danth mentioned this pull request Mar 5, 2024
@danth
Copy link
Owner Author

danth commented Mar 5, 2024

Improved contrast for the status bar:

Screenshot of status bar

I think it's important that we keep the colored background, since in default VSCode, the status bar changes color to draw attention to certain situations.

@coffeeispower
Copy link

coffeeispower commented Mar 5, 2024

@danth Yes, the only case the status bar changes color is when you're debugging actually, i've never seen other cases where the status bar changes color.
I was going to say that you need to adjust the button colors, but I saw you have that on your todo list.

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

#272 i improved the button font contrast

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

#273

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

Suggestion: make editor rulers less distracting

"editorRuler.foreground": "#{{base01-hex}}",

Those that you declare with programs.vscode.userSettings."editor.rulers" = [ 80 120 ];

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

Suggestion: I think the status bar draws way too much attention with a seperate color. If you allow to make the vscode-stylix theme a bit more unique, I would change the whole status bar background (statusBar.background) to base02 or even base00/base01. Because I think the main focus should be on the editor not the status bar.

@danth
Copy link
Owner Author

danth commented Mar 6, 2024

If we were to do that, I would suggest matching the color of the sidebar.

We could have it match the sidebar by default, but keep a unique color for the debugging state?

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

Yes, exactly what i meant. So the following would be the only changes.

"statusBar.background": "#{{base01-hex}}",
"statusBar.foreground": "#{{base05-hex}}",
"statusBar.noFolderBackground": "#{{base01-hex}}",
"statusBar.noFolderForeground": "#{{base05-hex}}",

Opinions on the font color base05?

@dafitt
Copy link
Contributor

dafitt commented Mar 6, 2024

Suggestion: The font and selectionBackground of the find/replace fields dont have the best combination, but i dont find the exact option for that.

Pasted image
Pasted image 1

@danth
Copy link
Owner Author

danth commented Mar 7, 2024

Yes, exactly what i meant. So the following would be the only changes.

"statusBar.background": "#{{base01-hex}}",
"statusBar.foreground": "#{{base05-hex}}",
"statusBar.noFolderBackground": "#{{base01-hex}}",
"statusBar.noFolderForeground": "#{{base05-hex}}",

I committed these. base05 is already used for the sidebar so using it on the status bar too will keep things consistent.

@danth
Copy link
Owner Author

danth commented Mar 7, 2024

It would be interesting to change the background color of the File menu to match the tab bar. I'm not sure about other environments, but it looks quite out of place under GNOME:

Screenshot of menu bar

The color of the selected tab could also use some adjustment.

@dafitt
Copy link
Contributor

dafitt commented Mar 7, 2024

I think this is not possible with the "native" menubar, because then it uses the system colors. With the "custom" menubar it uses the stylix theme, which looks good. You need to change the menubar style this in the settings: "window.titleBarStyle": "custom"

For the selected tab, i think tab.activeBackground is the key you're searching.

@dafitt
Copy link
Contributor

dafitt commented Mar 7, 2024

By the way, here is the vscode theming reference: https://code.visualstudio.com/api/references/theme-color

@danth
Copy link
Owner Author

danth commented Mar 7, 2024

Suggestion: The font and selectionBackground of the find/replace fields dont have the best combination, but i dont find the exact option for that.

Looking at the guide I think this uses the input control colors

@danth
Copy link
Owner Author

danth commented Mar 7, 2024

I think this is not possible with the "native" menubar, because then it uses the system colors. With the "custom" menubar it uses the stylix theme, which looks good. You need to change the menubar style this in the settings: "window.titleBarStyle": "custom"

We may be able to change the native menubar via GTK/Qt instead, but I'll work on that separate from this PR.

@dafitt
Copy link
Contributor

dafitt commented Mar 8, 2024

Suggestion: make editor rulers less distracting

"editorRuler.foreground": "#{{base01-hex}}",

@danth Could you please check with your light theme, if you still see the ruler with that color? And make a quick commit for me?

@coffeeispower
Copy link

imagem

I think this can be improved, it should have more contrast than the rest of the lines, not less

@coffeeispower
Copy link

Btw will this be backported to 23.11? I use stable nix os

@danth
Copy link
Owner Author

danth commented Mar 8, 2024

We don't really have a system in place for backporting right now, but it can be done.

@coffeeispower
Copy link

@danth you can just copy and paste the template.mustache file in the release-23.11 branch, it's not really a problem.

@danth
Copy link
Owner Author

danth commented Mar 9, 2024

Suggestion: make editor rulers less distracting

"editorRuler.foreground": "#{{base01-hex}}",

Could you please check with your light theme, if you still see the ruler with that color? And make a quick commit for me?

It's very difficult to see with base01:

Screenshot with base01

base02 is an improvement:

Screenshot with base02

This still isn't the best, but my scheme is quite low contrast in general, so it could just be down to that. Refer to this GNOME menu to see what I mean.

Screenshot of GNOME menu

The original value for comparison. I see what you mean about it being distracting.

Screenshot with base03

I think we should compromise on base02, and change the indent guides to match.

@danth
Copy link
Owner Author

danth commented Mar 9, 2024

I discovered several newer options were missing from the template. These are now set to null, and most should be given a value before this is merged.

I also added a script to do this by parsing the reference page. (Quicker than doing it by hand 😅)

@danth
Copy link
Owner Author

danth commented Mar 9, 2024

Also discovered that comments are practically invisible in diffs.

Screenshot of comments in diff

@coffeeispower
Copy link

coffeeispower commented Mar 9, 2024

Only good changes with this pull request! I'm liking it! 📈
By the way wouldn't it be better to use the workbench.colorCustomizations setting instead of installing an extension? I have to restart vscode everytime and it's quite annoying, with settings.json it hot reloads.

@danth
Copy link
Owner Author

danth commented Mar 9, 2024

Absolutely, we can work on converting to that method after this PR is done.

@dafitt
Copy link
Contributor

dafitt commented Mar 9, 2024

Thank you @danth for your time, you're awesome! base02 for the rulers looks fine.

I wonder how you are testing the changes. I just put the changes manually into my nix-hm-configuration under programs.vscode.userSettings."workbench.colorCustomizations" like you saw in my issue.

@danth
Copy link
Owner Author

danth commented Mar 9, 2024

Change your Flake input to git+file:///path/to/stylix (or github:danth/stylix/vscode-adjustments if you're testing changes that were already pushed) and rebuild.

Then press Ctrl+Shift+P in VSCode and search for "Developer: Reload window" to apply the changes. It usually prompts you to reload it a second time.

@danth danth marked this pull request as ready for review March 17, 2024 15:13
@danth
Copy link
Owner Author

danth commented Mar 17, 2024

There are a few minor tasks left to do, but I'm planning to merge this soon so the bigger changes aren't delayed for too long.

Of course, follow-up PRs are welcome.

@danth danth merged commit 4d29962 into master Mar 18, 2024
5 checks passed
@danth danth deleted the vscode-adjustments branch March 18, 2024 00:38
@danth
Copy link
Owner Author

danth commented Mar 20, 2024

By the way wouldn't it be better to use the workbench.colorCustomizations setting instead of installing an extension?

I tried implementing this, but any colors we set to null are inherited from the default theme. See the black borders in the screenshot below.

Screenshot from 2024-03-20 11-17-06

With the current implementation, it inherits from other colors within our extension instead.

We could work around this by defining all the colors explicitly, but then any update would cause newly added options to default to null, and the problem would resurface until we updated the template.

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

Successfully merging this pull request may close these issues.

Finetune VSCode theme
3 participants