Created
September 30, 2017 19:13
-
-
Save guysolamour/7890573399acef9b30cc0be26b218e0b to your computer and use it in GitHub Desktop.
SASS mixin to convert pixel to em
This file contains hidden or 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
/* Px to Em Converter | |
* @Author: Bashar Ayyash | |
* @Version: 1.0 | |
* @Date: 04 May, 2013 | |
* */ | |
@function px_to_em($target, $context: $base-size) { | |
@if $target == 0 { @return 0 } | |
@return $target / $context + 0em; | |
} | |
$base-size = 16px;//you can customise this variable to what you need |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment