Created
January 21, 2015 09:06
-
-
Save githiro/7566d62eceee2c7fe381 to your computer and use it in GitHub Desktop.
SASS: font-size mixin.Get px and rem-based "font-size: value" set. Foundation framework's rem-calc() function is required.
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
@mixin font-size($sizeValue: 1.6, $force: false) { | |
$unit: unit($sizeValue); | |
@if $unit == "px" { | |
$sizeValue: strip-unit($sizeValue); | |
@if $force == true { | |
font-size: $sizeValue + px !important; | |
font-size: rem-calc($sizeValue) !important; | |
} @else { | |
font-size: $sizeValue + px; | |
font-size: rem-calc($sizeValue); | |
} | |
} | |
@else { | |
@if $force == true { | |
font-size: ($sizeValue * 16) + px !important; | |
font-size: $sizeValue + rem !important; | |
} @else { | |
font-size: ($sizeValue * 16) + px; | |
font-size: $sizeValue + rem; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment