VSCode:更改固定选项卡 - 缩小字体或增加选项卡宽度

Jos*_*han 0 visual-studio-code

我正在使用自定义 CSS 加载器,一切都已设置完毕。

我可以更改 VSCode 的 CSS 并进行更改。但由于某种原因我唯一无法更改的是选项卡中的文本。

当我只调整选项卡的字体大小时,我可以更改图标大小。但它对文本大小没有影响。

我尝试增加选项卡的宽度,但没有成功。

我只能猜测 .tab-container 和 .tab 的作用。

这是我想要改变的: 需要调整字体大小或固定标签宽度

这是我从 VSCode 问题中某人的建议中窃取的 CSS 代码:

:root {
    --size-reduction: 12px;
}

.monaco-shell {
  font-family: "JetBrains Mono", "Monoco", monospace;
}

.tabs-container .tab,
.tabs-container .monaco-icon-label,
.tabs-container .monaco-icon-label::before,
.tabs-and-actions-container .editor-actions {
    height: unset !important;
}

.monaco-workbench .tabs-container .tab * {
  font-size: 0.5em;
  width: 100px;
}

.editor-instance > .monaco-editor,
.editor-instance > .monaco-editor .overflow-guard,
.editor-instance > .monaco-editor .monaco-scrollable-element {
    height: 100% !important;
}

.editor-instance,
.editor-instance > .settings-editor .settings-toc-wrapper,
.editor-instance > .settings-editor .settings-editor-tree {
    height: calc(100% + var(--size-reduction)) !important;
}

.editor-instance > .settings-editor {
    height: calc(100% - var(--size-reduction)) !important;
}
Run Code Online (Sandbox Code Playgroud)

有人可以分解每个元素(.tab、.tab-container 等)或向我指出分解所有元素的来源吗?

另外,如果我调整选项卡内的字体大小,为什么选项卡的字体没有缩小?

我的固定选项卡大小设置为“缩小”。我尝试将其从 Compact 和 Norman 更改为字体大小没有差异。

我的编辑器常用字体是“Jetbrains Mono”。

Jos*_*han 5

承认这个答案并没有回答我最初的询问“改变宽度或字体大小的收缩固定选项卡”。

但是,在不使用 CSS-Custom-Loader 和摆弄粘胶的 css 的情况下,我找到了一个使用 UI 设置的更优雅的解决方案。

如何使收缩固定选项卡与选项卡内的更多上下文配合使用

三个设置要注意:

  • 固定标签尺寸:正常
  • 工作台 > 编辑器:选中“显示选项卡”
  • 工作台 > 编辑器:选项卡尺寸缩小

现在我一次会固定 8 到 10 个选项卡。因此,这将非常适合工作空间。

如果我有 30 个固定标签,我不知道它是否会显示出足以产生影响的内容。