Created
August 4, 2015 07:10
-
-
Save joshuacerbito/52a83321c96f0b0a9863 to your computer and use it in GitHub Desktop.
Handles font-size caculations
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
$base-font-size: 16px; | |
// Calculate rem value | |
@function calculateRem($size) { | |
$remSize: $size / $base-font-size; | |
@return $remSize * 1rem; | |
} | |
// Calculate Viewport-Width dependent value | |
@function calculateVW($size) { | |
$vwSize: $size / $base-font-size; | |
@return $vwSize * 1.2vw; | |
} | |
// Font-Size Handling | |
@mixin font($size, $weight: regular, $style: normal) { | |
font-family: $omnes; | |
font-size: $size; | |
@if $size != 'inherit' { | |
font-size: calculateRem($size); | |
} | |
@if $style == 'italic' { | |
font-style: italic; | |
} @else { | |
font-style: normal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment