Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Bartik theme removes the visual indicator (pink background) for unpublished nodes.
node.css has a .node-unpublished style (line 2):
.node-unpublished {
background-color: #FFF4F4;
}
That is overwritten by bartik's style.css when the class "node-full" is present (line 605):
.node-full {
background: none repeat scroll 0 0 transparent;
...
}
I added the following style to a custom stylesheet:
.node-full.node-unpublished {
background-color: #FFF4F4;
}
Would this be a reasonable addition to bartik's style.css?
Comment | File | Size | Author |
---|---|---|---|
#8 | 1854376.jpg | 8.2 KB | gaurav-mathur |
#4 | nopatch.png | 14.68 KB | theMusician |
#4 | pinkwithpatch.png | 12.3 KB | theMusician |
#1 | core-Bartik_overrides_unpublished_style_from_node.css-1854376-1.patch | 366 bytes | _vid |
Comments
Comment #1
_vid CreditAttribution: _vid commentedHere's a patch for testing.
Comment #2
_vid CreditAttribution: _vid commentedComment #3
antoniotorres CreditAttribution: antoniotorres commentedApplied the patch and everything works and looks good.
Comment #4
theMusician CreditAttribution: theMusician commentedThe patch does indeed add the pink background. I have attached an image prior to the patch and one after the patch.
No patch:
With patch:
It certainly appears that the light pink background should be included on full nodes as unpublished comments have the light pink background.
Comment #5
_vid CreditAttribution: _vid commentedNice thanks for reviewing it.
By the way I made the patch from a diff and so I suppose this will be the correct commit line:
git commit --author="vid <vid@631512.no-reply.drupal.org>"
Comment #6
David_Rothstein CreditAttribution: David_Rothstein commentedLooks like this is fixed in Drupal 8 already, but for Drupal 7 really needs more reviews and cross-browser testing. We especially need to be very careful to make sure that a fix for this won't break subthemes.
This also looks like it has been discussed in great detail in #862854: No styling for sticky, so I'll leave a note there pointing to this issue.
At first glance it's not clear why we'd override the .node-full override again (rather than removing it), although given the discussion in #862854: No styling for sticky the approach here might be more backwards-compatible?
Comment #7
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedComment #8
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedI applied the patch on my setup and everything works good.
Comment #9
Saman Malik CreditAttribution: Saman Malik commentedPatch Failed to apply
Comment #10
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedActually the patch from #1 still applies, see: https://www.drupal.org/pift-ci-job/2592523
Comment #11
apadernoI can confirm the provided patch still applies to the 7.x branch.