Status bar items do not preserve whitespace between codicons
See original GitHub issueExtracted 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:
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:
Opening up for help for a CSS wizard to look at. Ideally all whitespaces between 2 codicons are preserved for styling purposes.
Issue Analytics
- State:
- Created a year ago
- Comments:17 (13 by maintainers)
Top 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 >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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
gap
seems to stretch every status bar item then:This is really very specific to the fact that there is whitespace between the
span
, everything else is proper. I thinkgap
will cause other regressions.