I'm writing a CSS theme for a forum with nested comments. I want the top-level comments to have white background, the second-level comments to have grey background, third-level white, fourth-level grey, fifth-level white, etc.
This stylesheet would work for the first five levels:
#comments > .comment { background-color: white }
#comments > .comment > .comment { background-color: grey }
#comments > .comment > .comment > .comment { background-color: white }
#comments > .comment > .comment > .comment > .comment { background-color: grey }
#comments > .comment > .comment > .comment > .comment > .comment { background-color: white }
How can this be written so it will always work regardless of nesting depth?