Is there a way to get zebra striping on a custom panels layout? I've been looking hook_preprocess_panels, but I don't see a way to tell if I'm a certain layout is being used. I don't want it on all layouts, just one in particular. I have the layout made, and I figure if I can add a css even/odd class to a node in the panel, I should be able to get what I need.
1 Answer
If you use even/odd pseudo-classes, you don't need even/odd classes
:nth-child(even)
:nth-child(odd)
Example:
.parent_class > div:nth-child(even) {background: #CCC}
.parent_class > div:nth-child(odd) {background: #FFF}
or
ul.yourclass li:nth-child(even) {background: #CCC}
ul.yourclass li:nth-child(odd) {background: #FFF}