Skip to content

Instantly share code, notes, and snippets.

@Sam152
Created December 11, 2013 05:15
Show Gist options
  • Save Sam152/7905416 to your computer and use it in GitHub Desktop.
Save Sam152/7905416 to your computer and use it in GitHub Desktop.
@mixin view-one-column() {
$zen-column-count: 1;
.views-row{
@include zen-grid-item(1,1);
@include zen-clear(both);
}
}
@mixin view-two-columns() {
$zen-column-count: 2;
.views-row{
&:nth-child(2n + 1) {
@include zen-grid-item(1,1);
@include zen-clear(both);
}
&:nth-child(2n + 2) {
@include zen-grid-item(1,2);
@include zen-clear(none);
}
}
}
@mixin view-three-columns() {
$zen-column-count: 3;
.views-row{
&:nth-child(3n + 1) {
@include zen-grid-item(1,1);
@include zen-clear(both);
}
&:nth-child(3n + 2) {
@include zen-grid-item(1,2);
@include zen-clear(none);
}
&:nth-child(3n + 3) {
@include zen-grid-item(1,3);
@include zen-clear(none);
}
}
}
@mixin view-four-columns() {
$zen-column-count: 4;
.views-row{
&:nth-child(4n + 1) {
@include zen-grid-item(1,1);
@include zen-clear(both);
}
&:nth-child(4n + 2) {
@include zen-grid-item(1,2);
@include zen-clear(none);
}
&:nth-child(4n + 3) {
@include zen-grid-item(1,3);
@include zen-clear(none);
}
&:nth-child(4n+4) {
@include zen-grid-item(1,4);
@include zen-clear(none);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment