Styling of PEPs

Good catch; I just noticed that too.

This was my first thought too, but it wouldn’t look so good and still require modifying each original image to add it, a non-trivial amount of work especially for older PEPs, and which wouldn’t look as good anyway.

I’m personally a bit averse to bespoke hacks in the dark theme CSS/JS for specific PEPs, which switching the image would require, as far as I’m aware.

This seems like the best solution; anchors as in the linked example technically work (via .. invert-image: or similar) but only for one image per page; .. rst-class:: invert-image is a much cleaner solution. CSS filters and the invert() function should be usable on all browsers we support.

One note about SVGs: per MDN via caniuse, “CSS property: filter: On SVG element” is listed as unsupported for all browsers but FF, so if images are not dark mode compatible, we would need to retain PNGs for those images (which currently all displayed images are).

I surveyed the other images that might need this; expand the details sections to view screenshots

1 Like