vscode-bookmarks icon indicating copy to clipboard operation
vscode-bookmarks copied to clipboard

[FEATURE] - All Colors Settings to be Inside the Workbench Color Customizations.

Open pouyakary opened this issue 1 year ago • 1 comments

Hello, hope you're doing well. Thanks for the amazing extension. I could not have wanted this more.

I have a color theme that has two variants, one for dark and one for light mode. It is so exciting that your extension lets me customize the colors, but I wished all the color settings were included in the workbench.colorCustomizations. If that were the case I could have done 2 things that could have been so cool for me.

  • The first was to specify the colors in my theme, so all my users could have the customizations matched to their themes once they had the two installed together.

  • I could have specified dark and light variants. I switch to dark light based on the sun and so if you included the settings it could have been so meaningful for me.

You already have 3 settings that are included in the workbench.colorCustomization. Can you please also move the following there?:

  • bookmarks.backgroundLineColor
  • bookmarks.gutterIconBorderColor
  • bookmarks.gutterIconFillColor

Again, this extension is such an amazing thing. I'm so happy that I found it today! Thanks a lot !

pouyakary avatar Aug 27 '23 18:08 pouyakary

To give you an example of how cool that could be, the dart-code extension provides a feature that displays a comment indicating the end of a widget, denoted as a comment. In my theme I could have colored these specially for these, in both light and dark variants:

And I wish I could have colored the bookmark for my theme for both the dark and light variants like these:

pouyakary avatar Aug 27 '23 18:08 pouyakary

Hi @pouyakary ,

This is not yet possible, because there is no API available to extract the color from Themes, and I need the color in order ot create the icon on the fly. There is an issue in the VS Code repo (https://github.com/microsoft/vscode/issues/32813) asking for that, but no ETA.

I'm subscibed to that issue, so any news I will be notified. In the meantime, I'm closing this issue,

Thanks for your undestanding.

alefragnani avatar Apr 02 '24 22:04 alefragnani

I recently read the source of GitHub's Pull Request Extension on how they did it and it was really convenient: https://github.com/microsoft/vscode-pull-request-github/blob/main/package.json#L2721-L2731

You define a set of colors inside your package.json, and also give them a default value. Then a theme developer gets to define colors for that color you have defined and thus they can also support your extension on top of the normal colors the vscode has. The user as well can change the colors and even set them for different themes they have (like me for example for dark and light themes)

pouyakary avatar Apr 03 '24 13:04 pouyakary

Yep, that's exacly how contributed colors works, and the Bookmarks extension uses it (https://github.com/alefragnani/vscode-bookmarks/blob/04ab0ca3ffb0dc1302f80cd0764187ffee5c0656/package.json#L641) for some colors. The icon colors, on the other hand, can't use this approach, because the extension needs the hex value in runtime, and VS Code does not provide that, only a reference to a ThemeColor which is not useful to create the .svg file on the fly.

alefragnani avatar Apr 03 '24 20:04 alefragnani