Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASS: Wrong output when using nth functions in for loop #721

Open
philipisik opened this issue Feb 8, 2014 · 0 comments
Open

SASS: Wrong output when using nth functions in for loop #721

philipisik opened this issue Feb 8, 2014 · 0 comments

Comments

@philipisik
Copy link

Hi together

I get an incorrect output, if I use Sass nth functions in a for loop. I use CodeKit version 1.9.3 (8403) with sass version 3.2.12 on mac OS X version 10.9.1. My Sass version in terminal is 3.2.14 (Media Mark)

Scss:

$viewIcons:(list,grid);
$viewIconsFontSize:(21,22);

@for $i from 1 through length($viewIcons) {
    .view_#{nth($viewIcons, $i)} {
        &:before {
            font-size: #{nth($viewIconsFontSize, $i)}px;
            font-size: #{nth($viewIconsFontSize, $i)/16}rem;
        }
    }
}

Output css by Codekit:

.view_list:before {
  font-size: 21px;
  font-size: 1.3125rem; }

.view_grid:before {
  font-size: 22px;
  font-size: 22/16rem; }

The second class get not the calculated rem value.

If I use sass --watch on command line, I'll get the correct output.
I get the right result on codepen, too: http://codepen.io/anon/pen/EybCm

Cheers Philip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant