Lots of themes, like Corolla (light red), provide a different background color for unpublished pages.

Comments

rjacobs’s picture

As best I can tell the CSS for that unpublished background color is actually provided by core in modules/node/node.css:

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

The trick is that bootstrap manually excludes modules/node/node.css from being added (see the "exclude" lines in bootstrap.info) and does not provide its own styling for the "node-unpublished" class. I'm not sure if that was by design or not, someone else would need to speak to that.

Of course you could add-back the CSS above in your sub-theme in the meantime.

markhalliwell’s picture

Title: Different background color for unpublished pages » Unpublished nodes do not have a background color
Category: Feature request » Bug report

I've noticed this bug too over time, but keep forgetting to do anything about it.

AFAIK, this was just an oversight and not intentional. I inherited the excluded CSS files from core and haven't really paid too much attention to them.

I went ahead and took a look at modules/node/node.css and it appears to just contain the following:

.node-unpublished {
  background-color: #fff4f4;
}
.preview .node {
  background-color: #ffffea;
}
td.revision-current {
  background: #ffc;
}

I'm ok with just un-excluding this file entirely, I don't see why it ever was in the first place :-/

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new868 bytes

Yeah, the stuff in node.css seems pretty innocuous. My only guess would be that somewhere along the line someone figured they would implement better styles in bootstrap directly for this, and wanted to turn off (what would become) conflicting rules from core? Whatever the case, without an alternative implementation, sticking to what core is doing probably makes sense.

I've attached patch. Note that I didn't remove the whole exclude line, but rather just commented it out as per what appears to be a style for that info file (I'm guessing someone is tracking something by leaving commented-out exclusions in there). One character patches are always rewarding.

Also, it looks like they are trying to handle this better in D8 core - #867830: "Unpublished" style of rendered entities is not accessible (and looks bad). After that's settled maybe it could be inspiration for a "better" bootstrap-specific solution in D7. That would probably be another issue though.

  • markcarver committed 53d0957 on 7.x-3.x authored by rjacobs
    Issue #2180801 by rjacobs: Unpublished nodes do not have a background...
markhalliwell’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.