Closed adrinux closed 8 years ago
Further investigation. The config used in tests seems to work perfectly, specifically:
:root {
--modular-scale: 1.5 1 1.125 1.25;
}
Will experiment with different ratios.
It seems that the two ratios, minor second and major second, cause issues no matter what bases are used. e.g.
--modular-scale: 1.067 1 1.125;
or
--modular-scale: 1.125 1 1.33;
That the numbers come out different from modularscale.com is one thing, but missing numbers and numbers higher than one listed below one is obviously a problem.
EDITED: Correction. Choice of base does make a difference, using the square root of the ratio for the second base (as you suggested elsewhere) works ok:
--modular-scale: 1.125 1 1.061;
At first glance, this appears to be an issue whenever the ratio is smaller than the second base value. Good catch, I'll look into this.
@adrinux These issues should now be gone in v0.3.4
.
https://www.npmjs.com/package/postcss-modular-scale-unit
I ended up taking this as an opportunity to fully rewrite the internal class used by the plugin. Should be more solid overall now.
A few test fixtures were added to account for your use case:
https://github.com/erikjung/postcss-modular-scale-unit/blob/master/test/basesLarger-in.css https://github.com/erikjung/postcss-modular-scale-unit/blob/master/test/basesLarger-out.css
Confirmed working as expected now. Thanks for the quick fix :)
There seem to be two probably interconnected issues here. Firstly, when compared to modularscale.com's calculator the lowest value (-6) is missing causing all values to be off by one (except 0msu). As a result the value for 1msu ends up at -1msu.
You can test output msu values with a little css of course (change the selector if you don't have a header element):
I'm using the following for config:
And here's the relevant results on modularscale.com
To make this a little clearer: