modularscale / modularscale-sass

Modular scale calculator built into your Sass
http://www.modularscale.com
MIT License
1.98k stars 134 forks source link

node-sass and round() #77

Closed pyrsmk closed 10 years ago

pyrsmk commented 10 years ago

Hi!

I'm planning to use node-sass command with a project, but I'm issuing this following error in modular-scale/stylesheets/modular-scale/_pow.scss :

@if round($Exponent) != $Exponent {
    @warn "Unfortunately, you need Compass to use non-integer exponents";
}

If I'm right, libsass (and therefore node-sass) doesn't include compass by itself like sass executable does. Also, I'm not using it but bourbon. How can I make this to work?

scottkellum commented 10 years ago

Are you using non-integer numbers in the ms function? like ms(3.4)?

If your answer is no, then don’t worry about this, it will work fine. Please see the compatibility notes for more detail.

pyrsmk commented 10 years ago

But my answer is definitely yes :) Perhaps I didn't understand exactly how to use modular scales in my responsive designs... But I need grained results to have golden ratios at each level of my design (font-size, margins, line-heights, ...).

Should it work if I set a ms-base at 0.001rem per example?

scottkellum commented 10 years ago

You may want to have multiple values for ms-base. You can learn more about double standard scales here: http://alistapart.com/article/more-meaningful-typography

Non-integer values don’t really fall at the set intervals of the scale. Don’t get me wrong, I have used them as well, but it’s best to try to avoid them. Double standard scales provide a parallel scale that matches proportions at a different base resulting in more size options without having to go off your scale.

scottkellum commented 10 years ago

I would love to have a better pow() function outside of Compass but the algorithms for calculating non-integer exponents are just not worth it.

pyrsmk commented 10 years ago

Thanks for your anwers, I read this article and it clarifies some things to me. I'll try to set a double standard scale in my website, then.

Also, I'm the author of vertical-rhythmic. I'm doing a complete rewrite of the library and trying to have a great compatibility with modular-scale. That's why I'm doing several tests to well see how the whole thing should be working ;)

scottkellum commented 10 years ago

Sounds good. Yeah the variable changes I made in v2 were to make things play nice with Compass vertical rhythm. Good luck with your project.

pyrsmk commented 10 years ago

Thanks, I've just pushed the new version. You could take a look if you want, and maybe modify the modular scale documentation part if it seems wrong to you ;)