zellwk/typi

Non-integer exponents (modular-scale 2.x + ratios in $typi config)

strarsis opened this issue · 2 comments

@zellwk: Does typi handle internally non-integer exponents,
which would be rations used as input for ms-* functions?

I get this warning/notice when using modular-scale 2.x (as required by typi),
when using a ratio instead an integer in $typi configuration map:

$typi: (
  medlarge: (
    null: (ms(1.5), 1.45)
  )
);
WARNING: Unfortunately, you need Compass to use non-integer exponents

@strarsis Typi doesn't handle non-integer exponents. If you want this, you'll need a pow() function.

From Modular Scale's README:

Note on non-integer values

Unfortunately Sass doesn’t natively support exponents. This isn’t all bad news, you can either use Compass, mathsass, or another library that has a pow() function that supports non-integer values and this plugin will pick up on that function and use it. You will then be able to write values like ms(2.5). This is also a prerequisite for target sizes below.

Note: import mathsass before importing modular-scale (which is used by typi):

webpack example:

@import '~mathsass/dist/math';
@import '~modularscale-sass/stylesheets/modular-scale';
@import '~typi/scss/typi';