You are viewing limited content. For full access, please sign in.

Question

Question

Change background color for every other collection in a form

asked on June 30, 2021

Is there a way?

I have one collection that appends sets to the sets populated by a data source from a lookup and the result is one long form (around ~70 or so), which is ok. However if I can change the background color for every other collection, it will be easier to read for the user.

Any ideas?

 

Thanks!

0 0

Answer

SELECTED ANSWER
replied on June 30, 2021

you can use the :nth-child(even) or :nth-child(odd) CSS selector to target the repeatable collection elements.

In this example I set a custom class of myCollection on the target collection, but you could name that however you want.

.myCollection .form-q:nth-child(even) .rpx {
  background-color: gray;
}

 

0 0
replied on July 2, 2021

Beautiful, thanks!

0 0

Replies

replied on June 2, 2023 Show version history

Just as an FYI I was unable to get this to work for me.  However this code did.  Maybe because I am using the new Forms Designer.

.MyCollection .collection-set:nth-child(Odd) {background-color: gray; }

 

3 0
You are not allowed to follow up in this post.

Sign in to reply to this post.