Skip to content

Instantly share code, notes, and snippets.

@keeev
Created November 23, 2015 15:03
Show Gist options
  • Save keeev/793af466ab96d3e03a77 to your computer and use it in GitHub Desktop.
Save keeev/793af466ab96d3e03a77 to your computer and use it in GitHub Desktop.
Convert PX to EM (LESS)
/*------------------------------------*\
PX to EM Converter
Syntax: .em(45) => 2,81em
\*------------------------------------*/
@browser-default-font-size: 16; //px
.em (@value, @context: @browser-default-font-size) {
font-size: (@value/@context) + 0em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment