Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Different color patterns for different repeating sections

1573301071

Edited 1573301120
Loki
Sheet Author
Hi! I have this piece of CSS that automatically assigns a specific color to the input fields inside each odd row and the row itself: div .repitem:nth-child(odd), div .repitem:nth-child(odd) input, div .repitem:nth-child(odd) select { background-color: #81BEF7; } This works so far. Now I want to add repeating sections with another color pattern without changing the old color pattern (so I can have repeating sections with different patterns in the sheet). Having still problems with CSS I'm wondering how to achieve this (that other repeating sections, for example with another class, have another color pattern). I thought about something like div .repitem:nth-child(odd) > .newPattern, div .repitem:nth-child(odd) > .newPattern input, div .repitem:nth-child(odd) > .newPattern select { background-color: #C7EAFF; } but that didn't work. I can assign a specific background-color to a specific repeating section with [data-groupname=repeating_specificsection] { background-color: red; } but this didn't work for the input-fields inside. And I'm pretty sure there is a more elegant way than assigning the color pattern to each repeating section individually. Can someone here help me with this? That would be awesome. Cheers!
1573308111
GiGs
Pro
Sheet Author
API Scripter
The div at the start is saying, apply the colours to any repeating rows inside a div So if you add a class to the div you want to apply a different colour to, like this <div class="mygreensection"> you can use this css div.sheet-mygreensection .repitem:nth-child(odd), div.sheet-mygreensection .repitem:nth-child(odd) input, div.sheet-mygreensection .repitem:nth-child(odd) select {     background-color: green; } and you'll get the color applied to that specific section.
1573309077
Loki
Sheet Author
That worked, thank you!
1573309141
GiGs
Pro
Sheet Author
API Scripter
You're welcome :)