Skip to content

Use CSS custom properties for Treescope's color palette - #74

Open
Auxeno wants to merge 1 commit into
google-deepmind:mainfrom
Auxeno:color-theme-vars
Open

Use CSS custom properties for Treescope's color palette#74
Auxeno wants to merge 1 commit into
google-deepmind:mainfrom
Auxeno:color-theme-vars

Conversation

@Auxeno

@Auxeno Auxeno commented Aug 8, 2026

Copy link
Copy Markdown

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, pytype and the test suite are green.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant