Use CSS custom properties for Treescope's color palette - #74
Open
Auxeno wants to merge 1 commit into
Open
Conversation
Treescope's colors were hardcoded at each place they were used, which made them impossible to configure. This collects them into `--treescope-*` properties on the root element and rewrites each usage to reference them, including arrayviz's axis labels, which set their color from JavaScript rather than from a stylesheet. Colors that already read correctly on any background are left alone, as are the block colors chosen by rendered objects. Renderings are unchanged. Two places now set a color explicitly rather than inheriting it -- arrayviz's hover tooltip and its axis labels -- but both resolve to the same value they inherited before.
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related Issue: Feature request: Dark mode #7
Treescope's colours are currently hardcoded at each place they're used, which makes them impossible to configure. This collects them into
--treescope-*properties on the root element and rewrites each usage to reference them, including arrayviz's axis labels, which set their colour from JavaScript rather than from a stylesheet.Renderings are unchanged. Two places now set a colour explicitly rather than inheriting it, arrayviz's hover tooltip and its axis labels, but both resolve to the same value they inherited before.
Colours that already read correctly on any background are left alone, as are the block colours chosen by rendered objects.
Collecting the palette into one place means it can be swapped wholesale, which is a prerequisite for dark mode.
pyink,pylint,pytypeand the test suite are green.