✍️ Markup#

Note

Sphinx supports two markup languages for writing documentation:

This page documents theme-specific classes and options that extend the standard markup.

Theme visibility#

Show or hide content based on the active theme. See Light and dark mode for more details on theme configuration.

Class

Description

.only-light

Only visible in light mode

.only-dark

Only visible in dark mode

.invert-light

Inverts colors in light mode

.invert-dark

Inverts colors in dark mode

Show/Hide example#

Display different images for each theme:

```{image} logo-light.png
:class: only-light
```
```{image} logo-dark.png
:class: only-dark
```
.. image:: logo-light.png
   :class: only-light

.. image:: logo-dark.png
   :class: only-dark

Invert example#

Automatically invert an image’s colors based on the theme. Useful for simple graphics, diagrams, or logos that work well when inverted.

```{image} diagram.png
:class: invert-dark
```
.. image:: diagram.png
   :class: invert-dark

Demo: This image inverts in dark mode (toggle theme to see the effect):

../../_images/qr-code.png