@import 'defaults', 'container', 'module', 'margin', 'utils/media', 'debug'; $modules: (); $dec-type: unquote("%"); @if $modular-render == true { $dec-type: unquote("."); } @for $i from 1 through $modular-max-cols { //Generate a pool of classes for later use. $modules: append($modules,unquote("#{$dec-type}#{$modular-prefix}#{$i}"),comma) !global; #{$dec-type}#{$modular-prefix}#{$i} { @include module-width($i); } } @for $i from 1 through $modular-max-cols { #{$dec-type}#{$modular-left-prefix}#{$i} { @include left-properties($i); } } @for $i from 1 through $modular-max-cols { #{$dec-type}#{$modular-right-prefix}#{$i} { @include right-properties($i); } } // //TODO Figgr' out how to optimize these loops. // @include media(iphone) { $iphone-subClasses: (); $left-iphone-subClasses: (); $right-iphone-subClasses: (); @for $i from 0 through $modular-max-cols { $iphone-subClasses: null; $left-iphone-subClasses: null; $right-iphone-subClasses: null; @for $j from 0 through $modular-max-cols { @for $k from 0 through $modular-max-cols { @if $i == $j and $j == $k { } @else { $iphone-subClasses: append($iphone-subClasses, unquote("#{$dec-type}#{$modular-prefix}#{$i}-#{$j}-#{$k}"), comma); $left-iphone-subClasses: append($left-iphone-subClasses, unquote("#{$dec-type}#{$modular-left-prefix}#{$i}-#{$j}-#{$k}"), comma); $right-iphone-subClasses: append($right-iphone-subClasses, unquote("#{$dec-type}#{$modular-right-prefix}#{$i}-#{$j}-#{$k}"), comma); //Add the variable sized modules to the pool. $modules: append($modules, unquote("#{$dec-type}#{$modular-prefix}#{$i}-#{$j}-#{$k}"),comma) !global; } } } @if $i == 0 { #{$iphone-subClasses} { display: none } } @else { #{$iphone-subClasses} { @include module-width($i); } } #{$left-iphone-subClasses} { @include left-properties($i); } #{$right-iphone-subClasses} { @include right-properties($i); } } } @include media(ipad) { $ipad-subClasses: (); $left-ipad-subClasses: (); $right-ipad-subClasses: (); @for $i from 0 through $modular-max-cols { $ipad-subClasses: null; $left-ipad-subClasses: null; $right-ipad-subClasses: null; @for $j from 0 through $modular-max-cols { @for $k from 0 through $modular-max-cols { @if $i == $j and $j == $k { } @else { $ipad-subClasses: append($ipad-subClasses, unquote("#{$dec-type}#{$modular-prefix}#{$k}-#{$i}-#{$j}"), comma); $left-ipad-subClasses: append($left-ipad-subClasses, unquote("#{$dec-type}#{$modular-left-prefix}#{$k}-#{$i}-#{$j}"), comma); $right-ipad-subClasses: append($right-ipad-subClasses, unquote("#{$dec-type}#{$modular-right-prefix}#{$k}-#{$i}-#{$j}"), comma); } } } @if $i == 0 { #{$ipad-subClasses} { display: none } } @else { #{$ipad-subClasses} { @include module-width($i); } } #{$left-ipad-subClasses} { @include left-properties($i); } #{$right-ipad-subClasses} { @include right-properties($i); } } } @include media { $desktop-subClasses: (); $left-desktop-subClasses: (); $right-desktop-subClasses: (); @for $i from 0 through $modular-max-cols { $desktop-subClasses: null; $left-desktop-subClasses: null; $right-desktop-subClasses: null; @for $j from 0 through $modular-max-cols { @for $k from 0 through $modular-max-cols { @if $i == $j and $j == $k { } @else { $desktop-subClasses: append($desktop-subClasses, unquote("#{$dec-type}#{$modular-prefix}#{$j}-#{$k}-#{$i}"), comma); $left-desktop-subClasses: append($left-desktop-subClasses, unquote("#{$dec-type}#{$modular-left-prefix}#{$j}-#{$k}-#{$i}"), comma); $right-desktop-subClasses: append($right-desktop-subClasses, unquote("#{$dec-type}#{$modular-right-prefix}#{$j}-#{$k}-#{$i}"), comma); } } } @if $i == 0 { #{$desktop-subClasses} { display: none } } @else { #{$desktop-subClasses} { @include module-width($i); } } #{$left-desktop-subClasses} { @include left-properties($i); } #{$right-desktop-subClasses} { @include right-properties($i); } } } // Make all the modules act like modules... #{$modules} { @include module-properties; }