bdkjones / CodeKit-1-Old

146 stars 1 forks source link

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

Open philipisik opened 10 years ago

philipisik commented 10 years ago

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