Skip to content

Commit 0fecaa4

Browse files
mrleemurraydileepyavan
authored andcommitted
Update file icon mask properties for improved styling (#331640)
fix: update file icon mask properties for improved styling Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
1 parent 3ce5013 commit 0fecaa4

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
}
4646

4747
.show-file-icons.chat-inline-anchor-widget .icon::before {
48+
--file-icon-mask-position: center;
49+
--file-icon-mask-size: contain;
50+
4851
display: inline-block;
4952
line-height: 100%;
5053
overflow: hidden;

src/vs/workbench/services/themes/browser/fileIconThemeData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ export class FileIconThemeLoader {
417417

418418
// When usesCurrentColor is set, image icons are rendered as masks filled with the current text color
419419
const imageIconStyle = (iconPath: css.CssFragment): css.CssFragment => iconThemeDocument.usesCurrentColor
420-
? css.inline`background-color: currentColor; background-image: none; mask: ${iconPath} no-repeat left center; mask-size: 16px; -webkit-mask: ${iconPath} no-repeat left center; -webkit-mask-size: 16px;`
420+
? css.inline`background-color: currentColor; background-image: none; mask: ${iconPath} no-repeat var(--file-icon-mask-position, left center); mask-size: var(--file-icon-mask-size, 16px); -webkit-mask: ${iconPath} no-repeat var(--file-icon-mask-position, left center); -webkit-mask-size: var(--file-icon-mask-size, 16px);`
421421
: css.inline`background-image: ${iconPath};`;
422422

423423
for (const defId in selectorByDefinitionId) {

src/vs/workbench/services/themes/test/browser/fileIconThemeData.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ suite('FileIconThemeData', () => {
4444
assert.deepStrictEqual({
4545
backgroundColor: content?.includes('background-color: currentColor'),
4646
mask: content?.includes('mask: url('),
47-
maskPlacement: content?.includes('no-repeat left center'),
48-
maskSize: content?.includes('mask-size: 16px'),
47+
maskPlacement: content?.includes('no-repeat var(--file-icon-mask-position, left center)'),
48+
maskSize: content?.includes('mask-size: var(--file-icon-mask-size, 16px)'),
4949
webkitMask: content?.includes('-webkit-mask: url('),
50-
webkitMaskSize: content?.includes('-webkit-mask-size: 16px'),
50+
webkitMaskSize: content?.includes('-webkit-mask-size: var(--file-icon-mask-size, 16px)'),
5151
noBackgroundImage: content?.includes('background-image: none')
5252
}, {
5353
backgroundColor: true,

0 commit comments

Comments
 (0)