question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Status bar items do not preserve whitespace between codicons

See original GitHub issue

Extracted from https://github.com/microsoft/vscode/issues/145722

If you bring up a status bar entry with 2 codicons next to each other only separated by whitespace, the 2 icons are still rendered as if there was no white space:

image

HTML is:

<a tabindex="-1" role="button" aria-label="label" class="disabled"><span class="codicon codicon-mark-github"></span> <span class="codicon codicon-mark-github"></span></a>

Code:

const statusService = accessor.get(IStatusbarService);

statusService.addEntry({
	name: 'name',
	ariaLabel: 'label',
	text: '$(mark-github) $(mark-github)',
}, 'my.id', StatusbarAlignment.LEFT);

I traced this down to the fact that the parent anchor tag of a status item uses display: flex and this seems to collapse whitespace elements, as outlined in e.g. https://www.mattstobbs.com/flexbox-removing-trailing-whitespace/

However, we already set white-space: pre as suggested:

https://github.com/microsoft/vscode/blob/0140fba8bb128d7481a4bcd380de774ab1210c5d/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css#L118

Opening up for help for a CSS wizard to look at. Ideally all whitespaces between 2 codicons are preserved for styling purposes.

//cc @daviddossett @misolori @joaomoreno

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
bpaserocommented, Mar 23, 2022

Yeah I think that would work at the place where we build the HTML elements, but I wouldn’t suggest to force extension devs to use it.

1reaction
bpaserocommented, Mar 23, 2022

gap seems to stretch every status bar item then:

image

This is really very specific to the fact that there is whitespace between the span, everything else is proper. I think gap will cause other regressions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

codicon | The icon font for Visual Studio Code
debug-line-by-line. debug-pause. debug-rerun ... no-newline ... save-all. save-as. save. screen-full. screen-normal. search-fuzzy. search-stop.
Read more >
Hiding "Spaces" element in VSCode status bar - Stack Overflow
Starting from VSCode 1.36 (June 2019), it is possible to hide any status bar elements (including those provided by extensions) by ...
Read more >
Product Icon Reference | Visual Studio Code Extension API
identifier default codicon ID description accounts‑view‑bar‑icon account Accounts icon in the view bar. breakpoints‑view‑icon debug‑alt View icon of the breakpoints view. callstack‑view‑icon debug‑alt View icon of...
Read more >
GitLens — Git supercharged
GitLens is an open-source extension for Visual Studio Code.
Read more >
Trending Plugins tagged as prototype | Figma Community
Please do not copy frames from the file where the trial period ended, this will ... Now, you can keep your RP prototypes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found