sass/ezy/grid/_layout.scss in ezy-0.2.9 vs sass/ezy/grid/_layout.scss in ezy-0.3.0.beta
- old
+ new
@@ -13,10 +13,12 @@
@function set-layout(
$columns,
$grid-padding : false,
$at-breakpoint : false,
+ $column-width : false,
+ $gutter-width : false,
$legacy-support : false
) {
// Catching media breakpoints from set-breakpoint
@if type-of( $at-breakpoint ) == "list" {
@@ -25,11 +27,11 @@
$legacy-support: nth( $at-breakpoint, 2 );
$at-breakpoint: nth( $at-breakpoint, 1 );
}
}
- $layout: ( $columns ($grid-padding) ($at-breakpoint) $legacy-support );
+ $layout: ( $columns ($grid-padding) ($at-breakpoint) $column-width $gutter-width $legacy-support );
// Storing layout
$layouts: append( $layouts, $layout, comma );
@return $layout;
@@ -37,22 +39,45 @@
}
// ---------------------------------------------------------------------------
// @mixin at-layout
-@mixin at-layout( $layout ) {
+@mixin at-layout(
+ $layout,
+ $legacy-support : false
+ ) {
// Storing reference to global variables
$at-breakpoint-ref : $at-breakpoint;
$total-columns-ref : $total-columns;
$grid-padding-ref : $grid-padding;
+ $column-width-ref : $column-width;
+ $gutter-width-ref : $gutter-width;
+ // Using settings from layout
$total-columns : nth( $layout, 1 );
$grid-padding : nth( $layout, 2 );
$at-breakpoint : nth( $layout, 3 );
- $legacy-support : nth( $layout, 4 );
+ $column-width : nth( $layout, 4 );
+ $gutter-width : nth( $layout, 5 );
+ // Use general settings if false
+ @if not $grid-padding {
+ $grid-padding : $grid-padding-ref;
+ }
+ @if not $column-width {
+ $column-width : $column-width-ref;
+ }
+ @if not $gutter-width {
+ $gutter-width : $gutter-width-ref;
+ }
+
+ // Get legacy support setting from layout if not forced
+ @if not $legacy-support {
+ $legacy-support : nth( $layout, 6 );
+ }
+
@if $at-breakpoint {
@include at-breakpoint( $at-breakpoint $legacy-support ) {
@content;
}
} @else {
@@ -61,10 +86,11 @@
// Resetting references to original values
$at-breakpoint : $at-breakpoint-ref;
$total-columns : $total-columns-ref;
$grid-padding : $grid-padding-ref;
-
+ $column-width : $column-width-ref;
+ $gutter-width : $gutter-width-ref;
}
// ---------------------------------------------------------------------------
// @mixin each-layout