Different colors for different types of posts

I’m using the SK3 theme on this site concrete-island.com. I have two types of posts, general information and locations. The layout is the same for both. I want to change the CSS so that each type of posts has its own color for headlines and links. Say “information” posts = cyan, “location” posts = pink. How can I achieve this?

I haven’t checked the theme, but in general, you can add a frontmatter field say color: "cyan". Then in the <div> that renders the post, you can add something like <div class = "{{ .Params.Color }}">...</div> The rest will be managed by CSS.

Reminder: Instead of “I am using $THEMENAME theme” please add a proper link to the Github repository of your used theme. This will make it easier for us to help you with your issue.

Sample: I am using the SK3 theme

In your case and according to @Hrishikesh’s suggestion, if your posts frontmatter has a parameter color: "#ff0000" (try keeping it with RGB colors) you can change the following line:


<div class="sk3-card box" {{ with .Params.color }}style="background-color: {{.}};"{{ end }}>

I would however go the extra mile and maybe use some kind of taxonomy-based system where you add classes per post type (if you have that defined) and then style the class, instead of adding stylesheets to the HTML.