Skip to content

Instantly share code, notes, and snippets.

@dhutchison
Created March 16, 2014 21:38
Show Gist options
  • Save dhutchison/9590310 to your computer and use it in GitHub Desktop.
Save dhutchison/9590310 to your computer and use it in GitHub Desktop.
Example of using property name interpolation in Less.
.mySelector {
.remSize(font-size, 1.2);
}
.remSize(@property; @sizeValue) {
@remValue: @sizeValue;
@pxValue: round((@sizeValue * unit(@fontSizeStandard)));
@{property}: ~"@{pxValue}px";
@{property}: ~"@{remValue}rem";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment