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
Fix widgets sometimes rendering in light theme when VS Code is in a dark theme (#2120)
(See related issues
microsoft/vscode-jupyter#7161 and
microsoft/vscode-jupyter#9403 for more
background)
Our CSS override to address the widget theming issue wasn't working
somtimes, which was very frustrating, as in Dark Mode our widgets would
often appear as they should in light mode.
The reason is that the order in which the style sheets get injected is
non-deterministic, and as the 'problematic' CSS rule and the override to
fix it have the same specificity, it would be 'last one wins'. Sometimes
our style-sheet is last and it works...
<img width="955" alt="image"
src="https://github.com/user-attachments/assets/281524d8-a3d5-4d15-a649-442a21b5ddec"
/>
And sometimes the IPyWidgets 'force it to white' rule is last so the
issue persists...
<img width="960" alt="image"
src="https://github.com/user-attachments/assets/f60f762e-0312-49de-9a2d-6f3cf4833b20"
/>
The unfortunate best _hack_ I could come up with is to programmatically
ensure the override CSS rule is always last in the `style`s in the
header.
Not pretty, but it works.
0 commit comments