Skip to content

Instantly share code, notes, and snippets.

@philippkuehn
Created March 16, 2015 11:03
Show Gist options
  • Save philippkuehn/ef2501c1fa8847ede764 to your computer and use it in GitHub Desktop.
Save philippkuehn/ef2501c1fa8847ede764 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
=font-size($sizeValue: 1.6, $lineHeight: 1.5, $important: false)
@if $sizeValue != false
@if type-of($sizeValue) == number
@if unitless($sizeValue)
font-size: ($sizeValue * 10) + px if($important, !important, null)
font-size: $sizeValue + rem if($important, !important, null)
@else
font-size: $sizeValue if($important, !important, null)
@if $lineHeight != false
@if type-of($sizeValue) != number
$sizeValue: 1.6
@if type-of($lineHeight) == number
@if unitless($lineHeight)
line-height: ($sizeValue * 10 * $lineHeight) + px if($important, !important, null)
line-height: ($sizeValue * $lineHeight) + rem if($important, !important, null)
@else
line-height: $lineHeight if($important, !important, null)
.lol
+font-size(1.4)
.rofl
+font-size(1.4, 1.2)
.iiihhh
+font-size(1.4, 1.2, true)
.lol {
font-size: 14px;
font-size: 1.4rem;
line-height: 21px;
line-height: 2.1rem;
}
.rofl {
font-size: 14px;
font-size: 1.4rem;
line-height: 16.8px;
line-height: 1.68rem;
}
.iiihhh {
font-size: 14px !important;
font-size: 1.4rem !important;
line-height: 16.8px !important;
line-height: 1.68rem !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment