Skip to content

Instantly share code, notes, and snippets.

@dippas
Last active May 5, 2017 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dippas/3bdd0bcfc11db4101c3ffacafcdf7d32 to your computer and use it in GitHub Desktop.
Save dippas/3bdd0bcfc11db4101c3ffacafcdf7d32 to your computer and use it in GitHub Desktop.
SASS error: Incompatible units: 'px' and 'px*px'
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
@mixin font-size($base: 16 ){
font-size: $base + px; //fallback for old browsers
font-size: (.0625 * $base) + rem;
}
$font-size-base: 14 !default;
$line-height-base: 1.846 !default;
$input-line-height: floor(($font-size-base * $line-height-base)) !default;
$input-padding-y: 6px !default;
$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;
div {
height:$input-height;
/*fonts with variable*/
font-size: ($font-size-base * 1px);
font-size: ($font-size-base * .0625rem);
/*fonts with mixin*/
@include font-size()
}
div {
height: 362px;
/*fonts with variable*/
font-size: 14px;
font-size: 0.875rem;
/*fonts with mixin*/
font-size: 16px;
font-size: 1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment