Problem/Motivation

The moderation control on an entity's latest version page (.entity-moderation-form) has a hard-coded white background in content_moderation.theme.css:

.entity-moderation-form {
  margin: 2em 0;
  padding-left: 1em;
  border: 1px dashed #bbb;
  background: #fff;
}

In a theme with a dark mode, such as the Default Admin theme, the control stays white while its labels and the "Moderation state" value use the theme's light text color, so they're barely readable.

 a white box with faint light gray labels and state

Steps to reproduce

  1. Install Content Moderation and the Default Admin theme, and set Default Admin as both the default and the administration theme.
  2. In Default Admin's theme settings (Appearance > Settings > Default Admin), set Appearance to Dark, or keep Auto with the system in dark mode.
  3. Add the Editorial workflow to a content type, create a published node, and save a draft of it.
  4. Open the node's Latest version tab. The moderation control is a white box with light gray labels.

Proposed resolution

Use the Default Admin theme's semantic color variables, with the current colors as fallbacks, as Making your module compatible with the Admin theme and dark mode recommends. Other themes keep the current white background and gray border:

.entity-moderation-form {
  margin: 2em 0;
  padding-left: 1em;
  border: 1px dashed var(--admin-color-border, #bbb);
  background: var(--admin-color-bg-surface, #fff);
}

Tried by adding these rules on a local site (11.4): in dark mode the control gets the theme's dark surface and border, and its labels are readable.

 a dark gray box with readable light labels

Stable 9's copy (core/themes/stable9/css/content_moderation/content_moderation.theme.css) stays as it is.

Remaining tasks

  • Merge request
  • Confirm the colors in Claro and Olivero don't change

User interface changes

The moderation control follows the Default Admin theme's colors, including dark mode. Other themes look the same.

API changes

None.

Data model changes

None.

AI disclosure

Claude Code found the cause while taking dark mode screenshots for a contributed module, tried the fix on a local site, and drafted this issue. I asked for the screenshots, reviewed the cause and the proposed CSS, and checked the before and after images.

Comments

dave reid created an issue.