You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pass theme colours to Widget Preview on querystring in the same format as DevTools #5702
To ensure the widget preview fits in whether it's in the sidebar or editor tab, we should pass the bg/fg colours on the querystring. They should be in exactly the same format as embedded DevTools pages (which I think is 6-digit hex code, with the hash being optional - since VS Code's URI class has encoding issues).
@bkonyi for DevTools, we support sending updated theme info via postMessage so that if the VS Code theme changes, we can update DevTools without refreshing and losing any state. Should we do the same here?
eg. we pass on QS for initial load, but then postMessage for updates:
Looks like there's no explicit background on the previewer, so the background from the sidebar already passes through.
theme.mp4
However I'm still making the change noted above, so we'll pass bg/fg colors + theme kind (dark/light) on the querystring initially, and then postMessage any changes to the frame.
It might also be useful for the user to be able to override the dark/light theme from the editor temporarily so they can review both themes without having to change their VS Code theme.
Activity
DanTup commentedon Sep 17, 2025
@bkonyi for DevTools, we support sending updated theme info via
postMessageso that if the VS Code theme changes, we can update DevTools without refreshing and losing any state. Should we do the same here?eg. we pass on QS for initial load, but then postMessage for updates:
And the initial querystring looks like:
Pass theme info to Widget Preview + support auth frame bouncing
DanTup commentedon Sep 22, 2025
Looks like there's no explicit background on the previewer, so the background from the sidebar already passes through.
theme.mp4
However I'm still making the change noted above, so we'll pass bg/fg colors + theme kind (dark/light) on the querystring initially, and then postMessage any changes to the frame.
bkonyi commentedon Sep 22, 2025
Ah, good catch! I didn't realize that. Either way, it'll still be good to have these colors to use for determining theming of the previewer elements.
DanTup commentedon Sep 22, 2025
It might also be useful for the user to be able to override the dark/light theme from the editor temporarily so they can review both themes without having to change their VS Code theme.