Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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