Sha256: 7b9690f3778e7ad6a7d605b264d66b9ee720c72d02123d7896a70385cf8f4447

Contents?: true

Size: 1.58 KB

Versions: 6

Compression:

Stored size: 1.58 KB

Contents

// /**
//  * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
//  * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
//  */
@if $trace-imports { @debug 'imported'; }

// Use for top and bottom margins and paddings
// Declare like: @include vertical-rhythm(1, padding-top);
// Uses the project's $base-line-height variable as declared in the Vertical Rhythm module settings
@mixin vertical-rhythm($lines, $property) 
{
	#{$property}: rhythm($lines);
}

// Use for left and right margins and paddings
// Declare like: @include horizontal-rhythm(1, padding-top);
// Uses the project's $column-spacing variable as declared in the Persistent Grid module settings
@mixin horizontal-rhythm($factor, $property) 
{
	#{$property}: horizontal-rhythm($factor);
}

// Mixin all four values at once
@mixin padding($units)
{
	$top:    nth($units, 1);
	$right:  nth($units, 2);
	$bottom: nth($units, 3);
	$left:   nth($units, 4);

	$top:    if($top!=0, rhythm($top), $top);
	$right:  if($right!=0, column-padding($right), $right);
	$bottom: if($bottom!=0, rhythm($bottom), $bottom);
	$left:   if($left!=0, column-padding($left), $left);

	padding: $top $right $bottom $left;
}

// Mixin all four values at once
@mixin margin($units)
{
	$top:    nth($units, 1);
	$right:  nth($units, 2);
	$bottom: nth($units, 3);
	$left:   nth($units, 4);

	$top:    if($top!=0, rhythm($top), $top);
	$right:  if($right!=0, column-padding($right), $right);
	$bottom: if($bottom!=0, rhythm($bottom), $bottom);
	$left:   if($left!=0, column-padding($left), $left);

	margin: $top $right $bottom $left;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
persistentgrid-0.0.1.beta.10 scss/pg/helpers/_baseline.scss
persistentgrid-0.0.1.beta.9 scss/pg/helpers/mixins/_baseline.scss
persistentgrid-0.0.1.beta.8 scss/pg/helpers/mixins/_baseline.scss
persistentgrid-0.0.1.beta.3 scss/pg/helpers/mixins/_baseline.scss
persistentgrid-0.0.1.beta.2 scss/pg/helpers/mixins/_baseline.scss
persistentgrid-0.0.1.beta.1 scss/pg/helpers/mixins/_baseline.scss