0
--space-unit: 1em;
--space-xl: calc(3.25 * var(--space-unit));

This calc(-1 * var(--space-xl)); should be a negative value.... but the -1 is ignored! The output is 3.25em.

Here is my gulp postcss Setup:

.pipe($.postcss([
  $.stylelint(),
  $.autoprefixer(),
  $.cssnano({
    discardComments: {
      removeAll: true
    },
    discardDuplicates: true,
    discardEmpty: true,
    minifyFontValues: true,
    minifySelectors: true
  }),
  $.postcssCustomProperties(), // IE 11
  $.postcssCalc(), // IE 11
  $.postcssReporter({
    clearReportedMessages: true
  })
]))

Any ideas?

QJan84
  • 786
  • 3
  • 9
  • 22
  • Dont know if this question will shed some light on things for you - https://stackoverflow.com/questions/25205039/is-it-possible-to-get-a-negative-value-with-css-calc – Andrew Jun 04 '19 at 13:50
  • It is `calc(-1 * 3.25 * 1)`. That should be negative but it isn`t. I think postcss causes the error. – QJan84 Jun 04 '19 at 13:56
  • Could you disable the line: $.postcssCalc() and see if it still builds wrong? – Wimanicesir Jun 04 '19 at 14:19
  • Then the result would be `calc (-1 * calc(3.25 * 1em)) `. Unfortunately that does not help, because the IE11 can not do anything with it. I use postCssCalc to resolve the nested calc and get a final score as the result. – QJan84 Jun 04 '19 at 15:19

0 Answers0