Created
January 12, 2016 18:37
-
-
Save davidyeiser/2184dd2802756d73e877 to your computer and use it in GitHub Desktop.
Typesetting with Sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function pem($target, $context: $em_base) | |
@return #{$target / $context}em | |
@function prem($target, $context: $em_base) | |
@return #{$target / $context}rem | |
@mixin setFont($face: "regular", $size: 0, $line-height: 0) | |
$family: "Helvetica Neue", Arial, sans-serif | |
$style: normal | |
$weight: normal | |
@if $face == "bold" | |
$family: "Helvetica Neue", Arial, sans-serif | |
$style: normal | |
$weight: 700 | |
@else if $face == "serif" | |
$family: Georgia, serif | |
$style: normal | |
$weight: 400 | |
@else if $face == "serif-italic" | |
$family: Georgia, serif | |
$style: italic | |
$weight: 400 | |
@else | |
$family: "Helvetica Neue", Arial, sans-serif | |
$style: normal | |
$weight: normal | |
font: | |
family: $family | |
@if $size != 0 | |
size: prem($size) | |
style: $style | |
weight: $weight | |
@if $line-height != 0 | |
line-height: pem($line-height, $size) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example use: