How to change font size in VS Code sidebar?

68,240

Solution 1

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:

Original Modified

Note that this also affects the command palette font.

Solution 2

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.

Hope this helps!

Solution 3

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.

Solution 4

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.

Solution 5

You can zoom in and zoom out:

zoom in:

Ctrl + +

zoom out:

Ctrl + -

Share:
68,240

Related videos on Youtube

z33k
Author by

z33k

not all who wander are lost

Updated on February 01, 2022

Comments

  • z33k
    z33k over 2 years

    Querying for fontsize in User Settings window yields only settings for:

    • editor panes,
    • suggest widget,
    • markdown preview,
    • integrated terminal

    as you can see below:

    enter image description here

    Doing the same for sidebar gives even poorer results:

    enter image description here

    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?

  • z33k
    z33k almost 6 years
    Good answer. I'll only add that there's also a simpler workaround of zooming out with CTRL+- to make all fonts smaller and then adjusting the ones we have control over accordingly. This however has a downside of scaling down also other UI elements like editor panes' tabs. It suited me, but your mileage may vary.
  • Mihai Chelaru
    Mihai Chelaru almost 6 years
    Yes, that's a far simpler alternative indeed. Perhaps you could post it as an answer to give it more visibility.
  • oyalhi
    oyalhi over 5 years
    I do this way also. However, sidebar's font either becomes 10 or 12, not 11 which I like. So I set the editor and terminal font size to 13, zoom out 1. The editor becomes 11, sidebar becomes 10. I can live with that at the moment.
  • corysimmons
    corysimmons about 5 years
    It's silly, but this is definitely the fastest and easiest-to-reason-about answer. Thanks.
  • Antonio Pavicevac-Ortiz
    Antonio Pavicevac-Ortiz over 4 years
    @corysimmons Thank you!
  • B2K
    B2K about 4 years
    The only thing missing from this answer is where to find the settings file. I was able to set the zoom level via the following: Sidebar > Manage > Settings > Window > Zoom Level. Then Text Editor > Font > Font Size
  • Antonio Pavicevac-Ortiz
    Antonio Pavicevac-Ortiz about 4 years
    @B2K Hi there! If you go to Code > Preferences > Settings you'll go to the GUI/pane for Settings, but then go to the top right, you'll see three icons, click the first one (from the left ) and it will take you to the settings.json file.
  • temporary_user_name
    temporary_user_name about 4 years
    Alternative you can just hit ⌘= to zoom, then adjust font.
  • windmaomao
    windmaomao over 3 years
    the zoomLevel is the killer.
  • Dila Gurung
    Dila Gurung over 3 years
    i followed every bits mentioned in, marketplace.visualstudio.com/… and copy and paste the following to custom css file but it did not work ..monaco-tree-row.has-children { font-weight: 500; margin: 8px; color: #eee; font-size: 14px; } .monaco-tree-row { font-weight: 300; margin: 5px; font-size: 12px; color: #bbb; }
  • scharfmn
    scharfmn about 3 years
    two years+ and this still worked beautifully
  • makkasi
    makkasi about 3 years
    while this works, it is not the correct answer, because the question asks to increase font size only, while this answer increases the bars, menu sizes and actually everything that is not text related.
  • makkasi
    makkasi about 3 years
    This is the best answer. It is the easiest. Also it doesn't increase the size of the icon bar, neither of the top bar. This way I don't lose space. Thank you.
  • ruffin
    ruffin almost 3 years
    @makkasi I think the point is that you can't edit the sidebar directly, but you can edit the "base" UI size and then edit the other text sizes to your preferences, which nearly reduces to the same thing. The downside, as you remark, is that there are side effects, but it does change the operative sidebar font size.
  • CodeConnoisseur
    CodeConnoisseur about 2 years
    Best answer here.