pretty straight forward but, I haven’t figured out how to get an alternating background going. basic structure is the query loop, within the post template i have a container > a two column grid > first column container > and a container with in that where im trying to have an alternating background, namely two different linear gradients representing the brands two main colors. This is on a page pointing to a set of posts from a custom post type. I’m able to change the background of a specific instance using the post id in the css, but cant get a ‘nth child’ working on my own. Feel like I’m missing what should be way easier to figure out.
here’s the code to change an instance of the background, with ‘zoom’ and ‘imgshapes’ being the classnames I have on the container in question in two different queries:
.zoom, .imgshapes {
background-image: linear-gradient(135deg, var(–accent), var(–accent-dark) 15%, rgba(0, 0, 0, 0) 15.2%, rgba(0, 0, 0, 0) 84.8%, var(–accent-dark) 85%, var(–accent));
}
.post-343695 > .gb-container > .gb-inside-container > .gb-container > .gb-inside-container > .gb-grid-wrapper > .gb-grid-column > .gb-container > .gb-inside-container > .zoom {
background-image: linear-gradient(135deg, #0059e8, var(–contrast) 15%, rgba(0, 0, 0, 0) 15.2%, rgba(0, 0, 0, 0) 84.8%, var(–contrast) 85%, #0059e8);
}