modularscale / modularscale-sass

Modular scale calculator built into your Sass

Home Page:http://www.modularscale.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check ms-list values

scottkellum opened this issue · comments

Some incorrect values are resulting, looks like the loop is missing some numbers from the secondary base including the base itself.

test case:

ms-list(-2, 5, 10px 16px, $major-third)

@canarymason This is a good place to get pretty deep into the new codebase. Basically I generate lists of all the possibilities and then merge-sort them into place (why merge sort? because they are already sorted lists and half the work is done).

This issue seems to be with the bounds of the loops that generate those lists: https://github.com/Team-Sass/modular-scale/blob/2.x/stylesheets/modular-scale/_generate-list.scss

I assume the ms(0) items in the list are getting trimmed off for some reason. Anyway, that is my assumption.

Notes:

  • You may have to comment out the sass:script in lib as when that is available, MS uses native-ruby stuff. Lets get this Sass nailed down first then fold the fix back into that.
  • This is Libsass, Sass 3.2, and Sass 3.3 compatible. I tried to comment where I found issue with one of these contexts and had to implement a workaround.

aside the missing secondary base value another pattern is showing - a shift in negative values. according to the calculator on modularscale.com you would expect 8.192 and 8.000 with your test values:

http://modularscale.com/scale/?px1=10&px2=16&ra1=1.25&ra2=0

but the shown values are shifted. instead of displaying the negative values at position 1 and 2, position 3 and 4 get displayed. things behaves accordingly for an example with a negative starting value of -6:

ms-list(-6, 12, 20px 44px, $golden);

http://modularscale.com/scale/?px1=20&px2=44&ra1=1.618&ra2=0

Should be fixed now