DevTools icon indicating copy to clipboard operation
DevTools copied to clipboard

How to access devtools theme CSS from an extension panel?

Open JustinGrote opened this issue 1 year ago • 3 comments

I have an extension that has a devtools panel. I want to match the colors in my panel to what is currently being used in the devtools theme. Is this fetchable somehow from the devtools panel context?

JustinGrote avatar Nov 11 '24 20:11 JustinGrote

Hi @JustinGrote, we recently deprecated the Visual Studio Code themes, so we only support the default Light+ and Dark+ themes now. You can use 'prefers-color-scheme' to detect which one is being used and respond on their panels accordingly. prefers-color-scheme - CSS: Cascading Style Sheets | MDN

leahmsft avatar Nov 18 '24 17:11 leahmsft

OK but is there no way to access the existing styling and colors for the light and dark themes? Do I have to hardcode the values based on what it is today? What if it changes?

JustinGrote avatar Nov 18 '24 17:11 JustinGrote

Unfortunately, there's no programmatic access existing today. I'll file this as a feature request on the engineering team's backlog for consideration. Thank you for your feedback!

leahmsft avatar Nov 20 '24 17:11 leahmsft