Skip to content

The .font-size mixin is broken. #16

Description

@randallbruder

The .font-size mixin (style.less, line 552) looks like this:

.font-size(@size){
    @rem-value: (@size / 10);
    @px-value: @size;
    @lineHeight: (@size * 1.48);
    line-height: @lineHeight+0px;
    font-size: ~"@{px-value}px"; 
    font-size: ~"@{rem-value}rem";
}

which, when compiled, causes the last two lines to look like this:

font-size: 10pxpx; 
font-size: 10pxrem;

because the @size being passed in contains a 'px'. It should be written this way:

.font-size(@size){
    @rem-value: (@size / 10);
    @px-value: @size;
    @lineHeight: (@size * 1.48);
    line-height: @lineHeight;
    font-size: unit(@px-value,px);
    font-size: unit(@rem-value,rem);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions