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/79635e9379a83b25698b to your computer and use it in GitHub Desktop.
Save borntorun/79635e9379a83b25698b to your computer and use it in GitHub Desktop.
less mixin to convert px to em/percent step-2
#convert-px-font-size {
.em(@px; @context) {
font-size: (@px/@context) + 0em;
}
.percent(@px; @context) {
font-size: (@px/@context) * 100 + 0%;
}
}
.myclass1 {
#convert-px-font-size > .em(32,16);
}
.myclass2 {
#convert-px-font-size > .percent(32,16);
}
@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