Skip to content

Light/dark mode support #3938

@ahyangyi

Description

@ahyangyi

Motivation
In the recent years, browser support for the light/dark modes are getting mature, and more and more websites are adding dark modes (or light modes if they were dark to begin with).

While it is not an absolute requirement for a syntax highlight theme to support both modes (e.g. sometimes it's fine to have dark code background on a light background web page), it is a useful functionality in many situations.

I am currently attempting to add dark mode support to my own theme, and I think it is in general something worth considering at the project level for Prism JS.

Description
Examine the existing official themes, and consider adding alternative light/dark modes for some of them.

Revise the website for users to preview both modes.

Consider adding a dark mode to the website itself (don’t you just love how meta this is?)

Alternatives
The obvious alternative is to provide an easy way for a user to specify two themes simultaneously, one for light theme and one for dark.

I think that people usually expect everything else (border width, font, spacing, etc) does not change between the light and the dark theme, so regardless what we do, the end result would not be people freely mix and match any light theme with any dark theme, so this alternative might be too much effort for too little gain.

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