Negative value?
See original GitHub issueThis 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?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Negative value - Wikipedia
Negative value may refer to: Negative predictive value in statistics; Negative ethic or philosophic value · Negative pricing · insolvency.
Read more >Value-Positive, Value-Neutral, and Value-Negative
Value-Negative · Straight-Pitching · Excessive Rapport-Building · Poor Questions · Weak Discovery · Lack of Insight · Poor Follow-Through · Lack of ...
Read more >Algebra Topics: Negative Numbers - GCFGlobal
A negative number is any number that is less than zero. For instance, -7 is a number that is seven less than 0....
Read more >Intro to negative numbers (article) - Khan Academy
Negative numbers help us describe values less than zero. Example: When the temperature is ...
Read more >Intro to negative numbers (video) - Khan Academy
Mysterious negative numbers ! What ARE they? They are numbers less than zero. If you understand the nature of below zero temperatures, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please provide full css code, i can’t understand problem
I cannot find a clear reproduction or even what the issue is.
calc(-1 * var(--space-xl))
works correctly. The original issue does not seem related to nested variables, anyway https://github.com/postcss/postcss-calc/issues/91 is keeping track of that.