Label unpublished content with text, not only a color (core #867830)

Task type
Project
Changed

Context

Core issue View on Drupal.org #867830#867830: "Unpublished" style of rendered entities is not accessible (and looks bad) Status: Active proposes the following:

  • a visible "Unpublished" marker on nodes and comments, with context for screen readers;
  • a status that does not rely on background color and still reads in forced-colors mode;
  • markers variables from template_preprocess_node() and template_preprocess_comment();
  • mark.html.twig gets a text status plus a type, and the MARK_NEW, MARK_UPDATED and MARK_READ constants are removed.

The work is on the issue fork branch 867830-unpublished-style-of, last pushed in July 2025. The latest comments (November 2026) lean towards a plain text label rather than a colored "warning".

Before this task, mantra_starter replaced core's pink background with a gray fill from --color-unpublished (libraries/drupal/unpublished.css), and did nothing else:

  • no text label and nothing for screen readers;
  • no forced-colors rule;
  • unpublished comments got a class that nothing styled;
  • mark.html.twig used constant('MARK_NEW'), which throws once core removes the constants.

Done

TODO

Questions

  • Should published-but-moderated states (draft, in review) get the same label? This follows comment 16851087 on the core issue.