kristoferjoseph / postcss-modular-scale

PostCSS plugin for adding modular scale to your styles
MIT License
53 stars 9 forks source link

Cannot use modular scale in combination with calc() #15

Open wc-matteo opened 8 years ago

wc-matteo commented 8 years ago

calc(ms(1)rem + 10px)

Error

TypeError in plugin 'gulp-postcss'
Message:
    Cannot read property '0' of undefined
Details:
    domain: [object Object]
    domainThrown: true
jakelazaroff commented 8 years ago

Can I see the order in which your postcss plugins are processed? For this to work, postcss-modular-scale needs to come before postcss-calc.

ensk commented 8 years ago

i have a similiar problem. i'm using precss, postcss-modular-scale and postcss-calc in that order what i'm doing

line-height: calc((ms(1)em / $base-line-height) * ($base-line-height / ms(1)em));

throw error and if set the value in a var and pass to calc like

$ms1: ms(1)em;

h1 {
    font-size: ms(1);
    line-height: calc(($ms1 / $base-line-height) * ($base-line-height /$ms1));
}

throw error ... if check the value of $ms1 has the expected value, but not work in calc. any idea of this error ??