VS Code customize sidebar - visual-studio-code

Is there any way to customize sidebar in VS Code? In particular, I want to change the font size. Is there a user setting for that? Or, maybe, I can edit it somehow via stylesheet since it's an Electron app, like in Atom?

There are no user-defined stylesheets for vscode.
The only ways to scale various parts of the UI currently are through the overall zoom level (window.zoomLevel) and the editor's font size (editor.fontSize).
I created a feature request for this on the repo.
As mentioned in other answers there are extensions which allow injecting custom CSS, you should be careful using these as they directly manipulate the source code of VS Code which could lead to problems elsewhere and any modifications could break when you update.

I Found a way to change the font of Visual Studio Code Window.
First, open command Pallete, and type "Toggle Developer Tools"
This will open "Chrome Inspector".
Select any text of sidebar of app.
Search .monaco-shell class in "styles" tab at right side inspector ( Where show every styles of the current document ), then the font-family attribute.This is tab and stylesheets.
In workbrench.main.css hit right click and click in "Open Soruce Panel" Show like this
Format the css Code with this icon.
ctrl+f for found font-family attribute again, 'cause the format redirect to end of css document, and get .monaco-shell class like this in ~6371 line.
Change this font ( I have change to Droid sans Mono font ), but you change to you want.
Why i'm not change in the real document css
'Cause, when i changed the font family in the real document css ( C:\Users\${user}\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\workbrench.main.css) generate a error saying "Vscode have a error, please reinstall the program" or similar
When generate a actualization of application, the font family declareated will deleted, and the document css is´t a pretty code.
This process change every fonts of visual studio code application (not include the editor font )

I found it very effective to use the general zoom settings (it's somewhere in that huge settings window). This adjusts the zoom level of the entire app. Tweak it till you like the size of your explorer window, then adjust the settable editor font to be readable with that zoom level. I three parallel code windows of 80 columns plus the explorer on a good 17" laptop monitor, readable if you are OK with 8pt code font (which is actually 11 point font zoomed two notches down).

Although there is no direct way of customize the sidebar from settings as #Daniel Imms mentioned in his answer, but I found 2 plugins which helped to resolve this issue. You can either one of them if you want.
1. Custom CSS and JS Loader
In Custom CSS and JS Loader plugin, you need to create a custom css and then this plugin will inject that code directly in electron-browser/index.html(as VS Code is an electron based editor). I use this CSS in my Mac:
".explorer-viewlet .mac": "font-size: 1.2em !important",
2. CustomizeUI
CustomizeUI relies on the Monkey Patch Extension to inject custom javascript in VSCode. Here is the settings I use (in settings.json) for my Mac:
"customizeUI.stylesheet": {
".explorer-viewlet .mac": "font-size: 1.2em !important; overflow: auto; border-left:none!important",
},

Related

Visual Studio Code workbench (explorer) line height

I have researched like the whole internet about Visual Studio Code and didn't find any information about workbench (explorer with the project directories and files) entries line height.
How can I change the line height in the workbench?
I am asking, because this standard line height in Version: 1.65.2 is too huge for the project with many directories and files. I want to see relevant directories and files in the right structure without continuing scrolling, so I have to decrease this line height.
It is impossible out of the box, but possible with the extension "Customize UI".
Link to the extension: Customize UI for VS Code
Last Update info as of 2022-11-16:
More Info
Version 0.1.65
Released on 6/6/2019, 7:47:09 AM
Last updated
9/25/2022, 3:51:30 AM
Publisher iocave
Unique Identifier iocave.customize-ui
Feature list from the Customize UI README:
This experimental extension allows customizing VSCode user interface beyond what's
normally possible, such as:
Changing interface fonts
Inline titlebar on macOS
Activity bar below sidebar
Custom stylesheet rules conveniently specified in settings.json

How to change font-size of vscode developer tool

The default font size of vscode developer tool (ctrl+shift+i) is too small for high dpi monitor and I want to make it bigger.
I do not find exact solution for it and I tried following related operations, but none of them works:
1. Set Window: Zoom Level
This configuration change size of everything except for the debugger tool, wired.
2. Set Editor:Font Size and Debug>Console: Font Size.
Still not affects the debugger tools.
3. Directy ctrl+scroll up/down using mouse
Not working. But works for editor if corresponding switch is on.
4. Configuration inside Developer tool.
Found no entry.
maybe you can try this.
...\Microsoft VS Code\resources\app\out\vs\workbench\workbench.desktop.main.css,
modify the font-size which is 11px to what you want .
(but it just effects the fonts in interface, not the variables in debug)
and is that ctrl+'+' not useful?
enter image description here

How to view truncated inline style CSS blocks in Chrome Dev Tools?

I'm trying to track down the source of some bad styling in the browser, but when I click through to the source of it from the Styles pane, I'm taken to one of many inline <style> blocks that are automatically generated on the page, which after a certain point, is truncated with …, as seen below. If I try to "Edit as HTML" or other methods to copy the block's contents, it doesn't expand this. Is there any way to see the full source of it?
Firefox can get the full style text.

How to change font size in VS Code sidebar?

Querying for fontsize in User Settings window yields only settings for:
editor panes,
suggest widget,
markdown preview,
integrated terminal
As you can see below:
Doing the same for sidebar gives even poorer results:
Having fonts of different sizes in editor panes and sidebar looks... let's settle with: not too nice. Have I just found the greatest omission of this awesome tool?
Just want to add to the discussion, If you set:
"window.zoomLevel": "your number",
In my case I started with zero, you can use that as sort of a baseline:
"editor.fontSize": 14,
"editor.tabSize": 2,
"terminal.integrated.fontSize": 14,
"window.zoomLevel": 0,
"[Log]": {
"editor.fontSize": 14
},
And then tweaked until I was happy.
E.g. you want to increase the sidebar font size keeping editor font size unchanged: set "window.zoomLevel": 0.5 and "editor.fontSize": 18. Look at the result. Play with both values to get the result you like.
Mihai Chelaru's answer presents a way to do more than just adjust the sidebar's font size. This, however, comes with a price of a bit of fiddling, possibly more than you'd be ready for, if the only thing you were interested in was the simple act of changing the sidebar's font size. So here's a simpler solution.
Just zoom the whole VS Code's UI in or out with CTRL++ or CTRL+- respectively and than adjust font sizes we do have control over in settings.json file, i.e.:
editor.fontSize,
editor.suggestFontSize,
markdown.preview.fontSize,
terminal.integrated.fontSize
so everything matches. That's it.
This has been a feature request for some time. The short answer is right now there's no VSCode setting that allows you to customize the sidebar font size. There is a hacky workaround solution proposed by #lindesvard in the same issue thread that involves using the Custom CSS and JS Loader extension to load in a custom CSS file that modifies the sidebar styling if you're willing to experiment with it.
To get this working follow the Getting Started section in the extension details, then add URLs to your custom files to the "vscode_custom_css.imports": [""] array. (Note that on Windows mine looks like the following: "vscode_custom_css.imports": ["file:///C:\\dev\\vscode-styling.css"])
Below are before and after adding the CSS mentioned by #PSVapour in a later comment:
Note that this also affects the command palette font.
Apart from #Mihai Chelaru's answer, I found another plugin which helped me dealing with this issue. The name of the plugin is CustomizeUI.
CustomizeUI relies on the Monkey Patch Extension to inject custom javascript in VSCode. Here is the settings I use (in settings.json) for my Mac:
"customizeUI.stylesheet": {
".explorer-viewlet .mac": "font-size: 1.2em !important; overflow: auto; border-left:none!important",
},
Again, this plugin is meant to do more than just changing the font size of the sidebar. But it has some minor advantages over Custom CSS and JS Loader. Like:
It won't show Unsupported on the title-bar or won't show any error message like Your installation is corrupted.
You do not have to reload settings every time VS Code is updated.
You can zoom in and zoom out:
zoom in:
Ctrl + +
zoom out:
Ctrl + -
Change the font size with keyboard shortcuts using the FontSize Shortcuts
plugin. On a Mac, I am able to focus on the terminal or the editor and change the font size of those areas independently of each other.
https://marketplace.visualstudio.com/items?itemName=fosshaas.fontsize-shortcuts
Mihai's answer above works well. He notes that the CSS from here has the side effect of changing the command palette font too.
I only wanted to specify the font size for the debugger sidebar tab. At the time of writing (VS Code version 1.74.3), this custom CSS instead affects only the debugger sidebar tab:
.debug-pane,
.debug-pane .scope,
.debug-pane .expression {
font-size: 14px !important
}

Is there a color picker plugin for Eclipse?

I'm using Eclipse Galileo PDT for my work. I also use it to edit my CSS files.
Is there a plugin that lets me pick a color (from a palette or even anywhere from the screen) and which returns the HEX value of that color into my CSS file?
Jspresso Colors 'n Fonts
Just select any java string literal and right click on it to open the contextual popup menu... then select Jspresso>Choose Color... or select Jspresso>Choose Font...
Supports also tooltip : fly over your string literal to display the current color or font... and activate hyperlink to open the editor popup !
Aptana Studio has really great support for CSS. CSS color picking is easy, you can grab a color from anywhere on the screen.
You can install Aptana as a plug into an existing Eclipse installation.
http://docs.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration
I would recommend to use external software: http://www.colorschemer.com/online.html
You can integrate it into Eclipse.
I have used this plugin called colors in both Galymeade and I just dropped into Galileo.
http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-1281.html you can copy the color code to/from clipboard or editor. Slider bar for coloring, color picker etc. I used it to edit css files on a recent project. Good Luck.
You might want to check out the second example at http://eclipsescript.org/#example-scripts.
I created a Groovy Monkey script that opens Eclipse's color picker. It was inspired by what fornwall pointed at (second example of Eclipse Script plugin). It's also able to recognize if current selection is a color so it can be selected it in the picker.
The script is on gist.github, instructions included.
Having a shortcut key for a script is not (yet?) possible in Groovy Monkey, but Crtl+Alt+M runs the last executed script.
A good plugin to consider is the Designerator Color Plugin from the Designerator project. It contributes a Colors view as explained in this blog post. No need to install the whole software, the color view is in a separate feature that can be installed by itself.
The Sampler plugin could also be of interest. However it does not show a color picker dialog where one can select a color, it only has the color picker tool for selecting a color from the screen.
There are a few plugins at the Eclipse plugins site that might meet your needs.
CSS Designer looks promising:
JointLogic CSS Designer is an Eclipse plugin that provides CSS authoring facilities like - CSS Styles view, CSS declaration designer with preview and web-oriented color picker. It integrates with Eclipse Web Tools Platform (WTP) to allow CSS authoring while editing CSS and HTML files.
Here's a screesnhot from the homepage: