Skip to content

Negative value? #87

Closed
Closed
@QJan84

Description

@QJan84

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

CSS:

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

    .offset {
      top: inherit; 
      @include mq(md) {
        top: calc(-1 * 3.25em); // this works
        top: calc(-1 * var(--space-xl)); // don't work - should be negative
      }
    }

Gulp Task:

    .pipe($.postcss([
      /*
      Stylelint
      */
      $.stylelint(),
      /*
      Parse CSS and add vendor prefixes to rules by Can I Use
       */
      $.autoprefixer(),
      /*
      cssnano is a modern, modular compression tool written on top of the PostCSS ecosystem, which allows us to use a lot of powerful features in order to compact CSS appropriately.
       */
      $.cssnano({
        discardComments: {
          removeAll: true
        },
        discardDuplicates: true,
        discardEmpty: true,
        minifyFontValues: true,
        minifySelectors: true
      }),
      /*
      PostCSS-Custom-Properties lets you use Custom Properties in CSS, following the CSS Custom Properties specification.
      Example: h1 { color: var(--color); } <-- BECOMES --> h1 { color: red; color: var(--color); }
       */
      $.postcssCustomProperties(), // IE 11 polyfill
      /*
      PostCSS plugin to reduce calc()

      IE11 don't understand nested calc functions like this:
      margin-bottom: calc(calc(1.25*1em)*1)
      */
      $.postcssCalc(),
      /*
      PostCSS Error Reporter
      */
      $.postcssReporter({
        clearReportedMessages: true
      })
    ]))

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions