Using one mixin from LESS within another mixin
Posted
by
user1165984
on Stack Overflow
See other posts from Stack Overflow
or by user1165984
Published on 2012-06-08T04:23:44Z
Indexed on
2012/06/08
4:40 UTC
Read the original article
Hit count: 367
I am trying to use a mix that calculates the base line height in another that contains my base font styles. Each time I try to compile, I get an error.
Here is an example.
.lineHeight(@sizeValue){
@remValue: @sizeValue;
@pxValue: (@sizeValue * 10);
line-height: ~"@{pxValue}px";
line-height: ~"@{remValue}rem";
}
.baseFont(@weight: normal, @size: 14px, @lineHeight: (.lineHeight(2.1)) {
font-family: @fontFamily;
font-size: @size;
font-weight: @weight;
line-height: @lineHeight;
}
The error is: TypeError: Cannot call method 'charAt' of undefined at getLocation (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:212:34) at new LessError (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:221:19) at Object.toCSS (/Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:385:31) at /Applications/CodeKit.app/Contents/Resources/engines/less/bin/lessc:107:28 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:434:40 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:94:48 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/index.js:116:17 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:434:40 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/parser.js:94:48 at /Applications/CodeKit.app/Contents/Resources/engines/less/lib/less/index.js:116:17
© Stack Overflow or respective owner