Background color for unpublished content entities

Created on 24 May 2023, about 1 year ago
Updated 15 June 2023, about 1 year ago

Problem/Motivation

When using a core theme (this is not in core modules), for node and some also for media, it add classes like:

core/themes/olivero/templates/content/node.html.twig:

    not node.isPublished() ? 'node--unpublished',

core/themes/olivero/templates/content/media.html.twig

not media.isPublished() ? 'media--unpublished',

Even if they only provide the background color for nodes:

.node--unpublished {
  background-color: #fff4f4;
}

The Bootstrap 3 theme provides similar feature on the class .is-unpublished.

Proposed resolution

Add some CSS in the ui_suite_bootstrap theme.

Targeting is-unpublished so it will can be global to any content entities.
Update node, media templates to add such CSS class.

Maybe with the danger color with some opacity? so it can be controlled with CSS variables.

Remaining tasks

Decide if we want to provide a similar support (@pdureau)
Implement such support

Feature request
Status

Fixed

Version

5.0

Component

Miscellaneous

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024