Sha256: 94ba0a5188b76295895383096d742668bdf1a6733da656b8f82b9ba6ac4e4c83

Contents?: true

Size: 2 KB

Versions: 2

Compression:

Stored size: 2 KB

Contents

// ------------------------------------------
// BLOCK GRID
//   Based heavily on ZURB's Foundation
// ------------------------------------------

$max-blocks     : 12 !default;
$block-distance : 15px !default;

@mixin block-grid-calc (
	$per-row  : false,
	$distance : em($block-distance),
	$collapse : false,
	$for-base : true ) {

	@if $per-row {
		width   : 100% / $per-row;

		&:nth-of-type(n) {
			clear: none;
		}
		&:nth-of-type(#{$per-row}n+1) {
			clear: both;
		}
	} @else {
		@if $collapse {
			padding : 0;
		} @else {
			padding : 0 ($distance / 2);
		}
	}
}

@mixin block-grid (
	$per-row  : false,
	$distance : em($block-distance),
	$collapse : false,
	$for-base : true ) {
	
	// For base class
	@if $for-base {
		display : block;
		padding : 0;

		@if $collapse {
			margin  : 0;
		} @else {
			margin  : 0 (-$distance / 2);
		}
		
		@include clearfix;

		& > li {
			position: relative;
			display : block;
			height  : auto;
			float   : $default-float;
			@include block-grid-calc($distance:$distance, $collapse:$collapse);
		}
	}

	@if $per-row {
		& > li {
			@include block-grid-calc($per-row:$per-row);
		}
	}
}

@if $include-block-grid {

/* ---------------
EDGE Block Grid
--------------- */

[class*="block-grid-"] {
	@include block-grid();
	
	&.collapse {
		@include block-grid($collapse:true);
	}
}

@for $i from 1 through $max-blocks {
	.large-block-grid-#{$i} {
		@include block-grid($per-row:$i, $for-base:false );
	}
}

@include small {
	// Make large-block-grid 100% width, but only on responsive site
	body:not(.not-responsive) {
		[class*="large-block-grid-"] > li {
			width: 100%;
		}
		@for $i from 1 through $max-blocks {
			.small-block-grid-#{$i} {
				@include block-grid($per-row:$i, $for-base:false );
			}
		}
	}

	// Remove large grid clearing
	@for $i from 1 through $max-blocks {
		.large-block-grid-#{$i} > li:nth-of-type(#{$i}n+1) {
			clear: none;
		}
	}
}




} // include-block-grid

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
edge_framework-0.6.1 assets/sass/edge/components/_block-grid.scss
edge_framework-0.6.0 assets/sass/edge/components/_block-grid.scss