Skip to content

Instantly share code, notes, and snippets.

@borntorun
Last active August 29, 2015 14:11
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 borntorun/f675b5ff2c081c24a046 to your computer and use it in GitHub Desktop.
Save borntorun/f675b5ff2c081c24a046 to your computer and use it in GitHub Desktop.
less mixin to convert px to em/percent step-3
#convert-px-font-size {
.calc(@px; @context; @multiply) {
@ret-convert-px:(@px/@context)*@multiply;
}
.em(@px; @context) {
.calc(@px, @context, 1);
font-size: @ret-convert-px + 0em;
}
.percent(@px; @context) {
.calc(@px, @context, 100);
font-size: @ret-convert-px + 0%;
}
}
@borntorun
Copy link
Author

gist from blog post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment