Skip to content

Instantly share code, notes, and snippets.

@pascalwhoop
Created April 26, 2015 10:24
Show Gist options
  • Save pascalwhoop/08bc1d6f02f12b40b6cf to your computer and use it in GitHub Desktop.
Save pascalwhoop/08bc1d6f02f12b40b6cf to your computer and use it in GitHub Desktop.
creating an alternating color decoration for wordpress page builder rows & columns
/* creating an alternating color decoration*/
/* first row after header*/
.panel-grid:nth-child(1n+1) .panel-grid-cell:nth-child(1n) .blocks-content{
background-color: #E84036;
}
.panel-grid:nth-child(1n+1) .panel-grid-cell:nth-child(2n) .blocks-content{
background-color: #FECB0D;
}
.panel-grid:nth-child(1n+1) .panel-grid-cell:nth-child(3n) .blocks-content{
background-color: #0F7CC1;
}
/* second row after header*/
.panel-grid:nth-child(2n+1) .panel-grid-cell:nth-child(1n) .blocks-content{
background-color: #0F7CC1;
}
.panel-grid:nth-child(2n+1) .panel-grid-cell:nth-child(2n) .blocks-content{
background-color: #E84036;
}
.panel-grid:nth-child(2n+1) .panel-grid-cell:nth-child(3n) .blocks-content{
background-color: #FECB0D;
}
/* third row after header*/
.panel-grid:nth-child(3n+1) .panel-grid-cell:nth-child(1n) .blocks-content{
background-color: #FECB0D;
}
.panel-grid:nth-child(3n+1) .panel-grid-cell:nth-child(2n) .blocks-content{
background-color: #0F7CC1;
}
.panel-grid:nth-child(3n+1) .panel-grid-cell:nth-child(3n) .blocks-content{
background-color: #E84036;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment