sass/ezy/_grid.scss in ezy-0.0.3 vs sass/ezy/_grid.scss in ezy-0.0.4
- old
+ new
@@ -79,14 +79,17 @@
// : Only mandatory if grid is fluid
// $gutter-property : Set to "margin" or "padding"
@mixin gutters(
$context: false,
- $gutter-property: $gutter-property
+ $property: false
) {
- @if $gutter-property == "margin" or $gutter-property == "padding" {
- #{ $gutter-property }: {
+ @if (not $property) {
+ $property: $gutter-property;
+ }
+ @if $property == "margin" or $property == "padding" {
+ #{ $property }: {
left: gutter( $context );
right: gutter( $context );
}
} @else {
@warn "$gutter-property must be set to either 'margin' or 'padding'";
@@ -206,44 +209,79 @@
@mixin span-columns(
$columns,
$context: false,
$at-breakpoint: false,
- $gutter-property: $gutter-property
+ $gutter-property: false
) {
$width: span-column-width( $columns );
- /* Spanning #{ $columns } of #{ $context } columns */
@if $is-fluid and $context {
+ /* Spanning #{ $columns } of #{ $context } columns */
$context-width: context-width( $context );
$pct-width: percentage-round( $width / $context-width );
width: $pct-width;
} @else {
+ /* Spanning #{ $columns } columns */
width: $width;
}
- @if $is-fluid {
- @if (not $at-breakpoint) {
- @if $total-columns < $context {
- @warn "Please check if $total-columns is set. $total-columns should be the highest number of columns occuring in your layout. This error will not break your layout, but will increase the CSS output.";
- @include gutters( $context, $gutter-property );
- } @else if (not $grid-init) {
- @warn "Include grid-init() after setting $total-columns for cleaner CSS output.";
- @include gutters( $context, $gutter-property );
- } @else {
- @extend %ezy-column-#{ $context };
- }
- } @else {
- @include gutters( $context, $gutter-property );
- }
- @if $columns > $context {
- @warn "You are trying to span #{ $columns } columns, but your layout only has #{ $context } columns.";
- }
- @if (not $context) {
- @warn $context-warn;
- }
- } @else if (not $grid-init) {
- @warn "Include grid-init() after setting $gutter-width for cleaner CSS output.";
+ @if $gutter-property and $is-fluid and $context {
@include gutters( $context, $gutter-property );
+
+ } @else if $gutter-property and $is-fluid and ( not $context ) {
+ @warn $context-warn;
+
+ } @else if $gutter-property and ( not $is-fluid ) {
+ @include gutters( $gutter-property );
+
+ } @else if $is-fluid and $context and $at-breakpoint {
+ @include gutters( $context );
+
+ } @else if $is-fluid and $context and ( $total-columns < $context ) {
+ @include gutters( $context );
+ @warn "Please check if $total-columns is set. $total-columns should be the highest number of columns occuring in your layout. This error will not break your layout, but will increase the CSS output.";
+
+ } @else if $is-fluid and $context and ( not $grid-init ) {
+ @include gutters( $context );
+ @warn "Include grid-init() after setting $total-columns for cleaner CSS output.";
+
+ } @else if $is-fluid and $context {
+ @extend %ezy-column-#{ $context };
+
+ } @else if $is-fluid { // $context not set
+ @warn $context-warn;
+
+ } @else if $grid-init { // Grid is static
+ @extend %ezy-column;
+
} @else {
- @extend %ezy-column;
+ @warn "Include grid-init() after setting $gutter-width for cleaner CSS output.";
+ @include gutters( $context );
}
+
+ // @if $is-fluid {
+ // @if (not $at-breakpoint) {
+ // @if $total-columns < $context {
+ // @warn "Please check if $total-columns is set. $total-columns should be the highest number of columns occuring in your layout. This error will not break your layout, but will increase the CSS output.";
+ // @include gutters( $context );
+ // } @else if (not $grid-init) {
+ // @warn "Include grid-init() after setting $total-columns for cleaner CSS output.";
+ // @include gutters( $context );
+ // } @else {
+ // @extend %ezy-column-#{ $context };
+ // }
+ // } @else {
+ // @include gutters( $context );
+ // }
+ // @if $columns > $context {
+ // @warn "You are trying to span #{ $columns } columns, but your layout only has #{ $context } columns.";
+ // }
+ // @if (not $context) {
+ // @warn $context-warn;
+ // }
+ // } @else if (not $grid-init) {
+ // @warn "Include grid-init() after setting $gutter-width for cleaner CSS output.";
+ // @include gutters( $context );
+ // } @else {
+ // @extend %ezy-column;
+ // }
}