Skip to content

Support automatic light/dark theme switching based on Sphinx theme #62

@semohr

Description

@semohr

Hello, thank you for the nice integration!

I'm currently using a Sphinx theme that supports both light and dark modes (e.g., Furo, pydata-sphinx-theme). Currently, I have to manually duplicate my typer blocks to handle both themes:

<div class="only-light">
'''{typer} app
---
prog: foo
theme: light
---
'''
</div>
<div class="only-dark">
'''{typer} app
---
prog: foo
theme: dark
---
'''
</div>

It would be great if sphinxcontrib-typer could automatically detect the current Sphinx theme mode and apply the appropriate light or dark theme. Maybe something like this could work:

'''{typer} app
---
prog: foo
theme_light: light
theme_dark: dark
---
'''

Please let me know if I'm missing something and there is an easier way to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions