Skip to content

Customise color of Codicon - Extensions custom view tree items #103120

@warrenbuckley

Description

@warrenbuckley

Goal

As an extension author, I wish to be able to customise the colors of icons used in tree items within my own custom view in conjunction with the colors contributions to allow consumers of the extension to tweak/change these colors if they wish to.

For example I wish to add some new colors via the package.json contributions method mentioned here but the documentation is limited and does not show any uses of where the retrieved color could be used to theme part of the UI, apart from fetching its value only.
https://code.visualstudio.com/api/references/contribution-points#contributes.colors

{
  "contributes": {
    "colors": [
      {
        "id": "iisexpress.startIcon",
        "description": "Color for the start icon tree item in the custom view.",
        "defaults": {
          "dark": "errorForeground",
          "light": "errorForeground",
          "highContrast": "#010203"
        }
      }
    ]
  }
}

Information

I have tried investigating how problemsWarningIcon.foreground is done in the codebase to see if I can do something similar and come across this file

https://github.com/microsoft/vscode/blob/8b7ea333ccc46fc8a27eda86199dfec57a4e255b/src/vs/platform/severityIcon/common/severityIcon.ts

It seems like registerThemingParticipant would be useful in order for me to do this, is anyone able to offer me some guidance or input please?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions