Sha256: e21cb24314b68b2f69027249845211c69a6dbade2e6196f1c826011a8c8924a4

Contents?: true

Size: 1.78 KB

Versions: 4

Compression:

Stored size: 1.78 KB

Contents

@import 'facades/setup';

$em-size: $font-size / 1em;
$em-unit: 1em;
$font-scale: 0 2 4 6 8;


@mixin font-size($size, $lines: lines-for-font-size($size)){
	$fsize: if(unit($size) == "em", $size, $size / $font-size);
	font-size: $fsize;
	@include leading($lines, $fsize);
}

@mixin leading($lines:1, $size:1em, $add-margin: false){
	line-height:rhythm($lines, $size);
	@if $add-margin == true { 
		@include margin-trailer($lines, $size);
	}
}

@function rhythm($lines, $size: $font-size){
	$r-height: $em-unit * $lines * $line-height / $size;
	$r-height: if( unit($r-height) == "px", $r-height / $em-size, $r-height);
	@return $r-height;
}

@mixin margin-trailer($lines, $size: $font-size){
	margin-bottom:rhythm($lines, $size);
}


@mixin margin-leader($lines, $size: $font-size){
	margin-top:rhythm($lines, $size);
}

@mixin padding-leader($lines, $size: $font-size){
	padding-top:rhythm($lines, $size);
}

@mixin padding-trailer($lines, $size: $font-size){
	padding-bottom:rhythm($lines, $size);
}


@function lines-for-font-size($size:$font-size) {
	$rhythm-line-height:if(unit($line-height) == "px", $line-height / $em-size, $line-height);
	$lines: ceil($size / $rhythm-line-height);
	@return $lines;
}

h1, h2, h3, h4, h5, h6, p, ol, ul{ 
	-webkit-margin-before:0;
	-webkit-margin-after:0;
}

h1{ 
	@include font-size(2em, 1);	
	@include margin-trailer(1, 2em);
}

h2{ 
	@include font-size(1.75em, 1);
	@include margin-trailer(1, 1.75em);
}

h3{ 
	@include font-size(1.5em, 1); 
	@include margin-trailer(1, 1.5em);
}

h4{ 
	@include font-size(1.25em, 1); 
	@include margin-trailer(1, 1.25em);
}

h5{ 
	@include font-size(1em, 1); 
	@include margin-trailer(1, 1em);
}

h6{ 
	@include font-size(0.9em, 1); 
	@include margin-trailer(1, 0.9em);
}

p, ul, ol{ 
	@include font-size(1em, 1); 
	@include margin-trailer(1, 1em);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facades-0.0.6 lib/facades/stylesheets/facades/typography/_baseline.scss
facades-0.0.5 lib/facades/stylesheets/facades/typography/_baseline.scss
facades-0.0.4 lib/facades/stylesheets/facades/typography/_baseline.scss
facades-0.0.3 lib/facades/stylesheets/facades/typography/_baseline.scss