Skip to content

[ENH]: Sphinx plot directive to support dark mode #25983

Open
@pllim

Description

@pllim

Problem

We are looking to deploy pydata-sphinx-theme on our docs (astropy/astropy#14867). The theme has a nifty light/dark mode toggle. Very quickly it is apparent that the generate plot using matplotlib's .. plot:: directive stays in light mode no matter what. The result could be pretty jarring.

Proposed solution

Would be nice for the .. plot:: directive to follow light/dark mode. Though you might want it as opt-in just in case some users do not want that, especially if you decide to use the CSS color-inversion trick that scipy does in https://github.com/scipy/scipy/blob/c1b803b66a3e9f0416f3feafc6d4cf24d2ec98e2/doc/source/_static/scipy.css#L133 .

Thank to @ksunden for pointing that out to me!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions