Created
February 15, 2018 17:11
-
-
Save haze83/c4a13083dbadff11274bb330bd5352cd to your computer and use it in GitHub Desktop.
convert indesign tracking value to the css letter-spacing equivalent
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
// convert indesign tracking value to css letter-spacing | |
@function tracking-to-letter-spacing($tracking: 0) { | |
@return $tracking / 1000 * 1em; | |
} | |
@mixin tracking-to-letter-spacing($tracking: 0) { | |
letter-spacing: tracking-to-letter-spacing($tracking); | |
} | |
// manually sample | |
.text-wide-manually { | |
letter-spacing: 40 / 1000 * 1em; | |
} | |
// function sample | |
.text-wide-function { | |
letter-spacing: tracking-to-letter-spacing(40); | |
} | |
// mixin sample | |
.text-wide-mixin { | |
@include tracking-to-letter-spacing(40); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment