I created a new Content type called Announcements. I want the Announcement nodes to have a specific background color.
Is that possible without going into coding level? is there a module that can change background colors? my search didn't come-up with any results.

Am using the ST Octoban theme.

Comments

vm’s picture

You could adjust the CSS via a module but it would still need you to provide the CSS to use. Suggest using CSS in a custom stylesheet for your subtheme.

chike’s picture

You can easily write CSS to target the content type, inspect one of the nodes to find a class you can target.

chike’s picture

That's to target the entire content type; to target a specific node, I am not sure how you can do that without making a template override for the node.

If you can make template overrides, that will be a better solution IMO so you can control more than even the background color for the content type or nodes.

vm’s picture

node-id my be in the body tag of the rendered source to target a specific node. IIRC, content type is also in there somewhere.

My bad - some themes produce the result I spoke of. ex: https://www.drupal.org/forum/support/theme-development/2015-12-14/how-to-add-a-node-id-as-class-to-the-tag-in-d8

slewazimuth’s picture

That seems like it might be a good Drupal 9 lesson subject. I think people should see how they might interact with the interface first. Then  have them do a more general approach.

vako’s picture

Looks promising. What is Color Snurd and when can we expect to see it in core?