Sha256: edf01a46da428b6d619c7f9d7691f08d277892f14b6e47ca9147045e8d3556e1

Contents?: true

Size: 1.6 KB

Versions: 48

Compression:

Stored size: 1.6 KB

Contents

// Sass math that will determine the width of the push, pull, prefix and suffix and write appropiate CSS
// ---------------------------- //
@mixin push_logic ($col_count, $grid_uom, $move, $width_gutter) {
	@if $grid_uom == em {
		$padding_width: #{($width_gutter * $col_count) / $em}em;
		@if $move == suffix {
			padding-right: $padding_width;
		}
		@else if $move == prefix {
			padding-left: $padding_width;
		}
		@else if $move == push {
			left: #{($width_gutter * $col_count) / $em}em;
		}
		@else if $move == pull {
			right: #{($width_gutter * $col_count) / $em}em;
		}
	}
	@else if $grid_uom == percent {
		$grid_width: ($width_gutter * $col_count) / $grid_960;
		$padding_width: #{($width_gutter * $col_count) / $grid_960};
		@if $move == suffix {
			padding-right: $padding_width;
		}
		@else if $move == prefix {
			padding-left: $padding_width;
		}
		@else if $move == push {
			left: ($width_gutter * $col_count) / $grid_960;
		}
		@else if $move == pull {
			right: ($width_gutter * $col_count) / $grid_960;
		}
	}
	@include box_sizing(content-box);
}


// Push, Pull, Prefix, Suffix logic 
// Paired down reusable logic, based on $type will determine width + gutter and 
// send values to the push_logic mixin to determine the value of the Push, Pull, Prefix or Suffix
// ------------------------------------------------------------------ //
@mixin ppps ($type, $col_count, $grid_uom, $move) {
	@if $type == 12 {
		$width_gutter: 80;
		@include push_logic ($col_count, $grid_uom, $move, $width_gutter);
	}
	@else if $type == 16 {
		$width_gutter: 60;
		@include push_logic ($col_count, $grid_uom, $move, $width_gutter);
	}
}

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
stipe-0.0.4.7 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.6 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.5 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.4 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.3 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.2 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.1 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.4.0 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.9 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.8 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.7 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.6 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.5 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.4 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.3 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.2 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3.1 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.3 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.2.9 stylesheets/stipe/grid/lib/_push_logic.scss
stipe-0.0.2.8 stylesheets/stipe/grid/lib/_push_logic.scss