Sha256: 2b4a43af4d6e3c40fb7309d7878b8cb121d29a8e1cbce5eb3d976e4b35bf23d4

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

// /**
//  * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
//  * Licensed under MIT; 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

2 entries across 2 versions & 1 rubygems

Version Path
persistentgrid-0.0.1.beta.12 scss/persistentgrid/utilities/_baseline.scss
persistentgrid-0.0.1.beta.11 scss/persistentgrid/utilities/_baseline.scss