Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal here is to simplify and unify everything to do with theme management. This mostly consists of:
qdk-theme.cssthemeObserver.tsThe CSS in
qdk-theme.cssis set up to accurately detect light or dark theme in VS Code, Jupyter, or the web. See the lengthy comments at the start of this file for how it works. ALL color management should be kept in this file.I have new widgets coming soon that need to react via code to theme changes, including in Python widgets, hence moving the existing code for this out of the
vscodedir and into npmqsharp-lang/uxmodule (where all the widgets live).For now, I've only ported the histogram widget to use the new
qdk-theme.cssvariables, as this was broken inside Jupyter notebooks previously. This now works correctly as shown below. Long term we should update all the widgets to use theqdk-*variables as done here for the histogram. This will provide consistency and (hopefully) simplicity.Jupyter Lab in default light mode:
After switching to dark mode:
With this change I also use the theme background color behind the widget, rather than solid white or black. The bar fill and font colors and still set to contrast with this and should still be legible even in weird themes, e.g., in 'Solorized light'
Or 'Red' theme