Skip to content

Improve editor UI on dark backgrounds #28200

@oandregal

Description

@oandregal

Here's the lowdown of how dark mode works in the editor at the moment (hat tip: @jasmussen):

  • WordPress does not support Dark Mode™ yet.
  • Themes might.
  • Whether Dark Mode or not, a theme might simply have a dark background.
  • On a dark background, an empty paragraph needs to have white placeholder text, or it won’t be legible.

The current solution is a boolean opt-in, that inverts the UI. This opt-in, add_theme_support( 'dark-editor-style' );, simply outputs is-dark-theme as a class in the body tag. This same class is also used in Cover to tell the editor UI to be inverted if Cover detects a dark background.

Can we refactor the is-dark-theme class name to be output based on the luminosity chosen by the background color of the root element in Global Styles, dynamically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions