Make some personalizations in vscode specifically for some theme - visual-studio-code

How to make some customization in vscode settings like font size and font weight specific for some theme. For e.g -> I want to do fontsize 15 for one theme but when I change to another it's fontsize should be 12, I mean for exmple :).

The easiest way to do so is to directly change the VSCODE font-size settings by going to
File->Settings->Searching Font-size->Changing it or Ctrl+, and doing the same process
You could also go to Font switcher extension and download it and directly type F1->Font size
And lastly, I think it seems no such feature exists for changing the font size according to the theme unless and until you are able to get very specific info such as some unique id or something about the theme you are using and apply certain code to your settings.json you may be able to modify it.

Related

Is it possible to change the font in VARIABLES in debugger in VSCode?

How can I change the font family and font size of variables in the screenshot in VSCode?
There is a GitHub issue discussing this problem:
Allow to change the font size and font of the workbench
and someone has added a PR to resolve it:
Add settings for changing the workbench font size and font #144365
So maybe you need to wait for vscode to merge this function.
By the way, in my case,
because the font in variables use the default font of windows10 system - Consolas.
So I choose to change the default font, using Jetbrains Mono to replace Consolas, and it works.

customize color theme for a file type or a specific extension

I m looking for a way to setup a specific color theme (or alter the default color theme)
based on the type of file edited by vs code
OR
depending on the used extension
I've read HOW TO setup a color theme and alter the default color theming but I could not find HOW TO setup a specific rendering based on file type. It seems the theme apply to the whole application. More specifically what I m interested in is to use say the "Light" color theme rendering while editing drawio file (graphical file edited using a dedicated extension) and use the "Dark" theme rendering for code editing (any other file type).
The extension I use refer to appropriate color theme and finally what might a good option would be to set a given color theme based on the extention involved to edit the file but that might require to dig into the extension source code.

VS code theme color is changed automatically

Above is today's color theme. Please see variable name SideMenu.
And another one is a picture which is taken few days ago.
You can see SideMenu color is different. It's not a problem of styled-components theme. Because every static variable's name's colors are changed.
It's not first time. few weeks ago, I had this experience and it's very annoying. Why the color theme of vs code (This is default Dark+ Theme) is changed automatically? I feel very unfamiliar with this color, and I want to stop the changing and hope to go back previous color.
How can I do that and Why this happens?
Ah! This is due to activation of Semantic Highlighting
You can disable or enable it to to get the coloring you want. Usually its enabled for default themes. If you disable it, you will get your old colors back.
You can disable/enable it here
Or you can add "editor.semanticHighlighting.enabled": false to settings.json
The is an option explorer.autoReveal in settings (either user or workspace) which controls if the explorer should automatically reveal files when opening them.
Open VS User Settings (Preferences > User Settings). This will open two side-
by-side documents.
Add a new "explorer.autoReveal": false setting to the User Settings document
on the right if it's not already there. This is so you aren't editing the
Default Setting directly, but instead adding to it.
Save the User Settings file.
Please enter your settings.json file for clear question. There might a code snippet like "workbench.preferredDarkColorTheme": "Default Dark+ Experimental" or "workbench.colorTheme": "so and so" in the settings.json. You have to remove this, because this might set your default theme to some preset theme. So, you will not be able to change your Color Theme on a fresh start.

How to override font for a specific theme?

Is there a way to set a specific font to be used for a certain VSCode theme? That is, every time I enable the theme, I want a particular font to be used for the editor, but revert to the default if I switch to any other theme.
To achieve this, you need to raeach to theme's codes where font is specifed. Changing the block with the font attritubute will change corresponding theme's font but when you change to any other theme, font would be changed accordingly as you wished.

How to modify the theme in VS Code

This is not a duplicate of how to configure theme options, that is clear from answers like this.
I'd like to modify or tweak the current setting, meaning: I'd like to load what is currently configured. For example the value currently configured for
editor.tokenColorCustomizations["[Cobalt2]"]["comments"]["foreground"]
to be able to tweak it a bit, say making the color more bright.
When I load this key in the User Settings I see a color red ("#FF0000) as default, which is obviously not what the theme has.
I know I can 1) open the cobalt2.json 2) find the setting and 3) copy/paste in my User Settings. But I was looking for a more friendly/easier approach.
Is there a more friendly/easier approach? How can I preload the current setting in my User Settings?
You can use this command from command palette:
Developer: Generate Color Theme From Current Settings
to see all the colors defined. If you have overwritten some colors in settings.json that change will be reflected too.
Command to assign to a keybinding: workbench.action.generateColorTheme.
Also, there is an open issue to fill the current value in settings: #25633