Title: Using more complex calculations in CSS calc expressions will be incorrect in production builds · Issue #17890 · angular/angular-cli · GitHub
Open Graph Title: Using more complex calculations in CSS calc expressions will be incorrect in production builds · Issue #17890 · angular/angular-cli
X Title: Using more complex calculations in CSS calc expressions will be incorrect in production builds · Issue #17890 · angular/angular-cli
Description: 🐞 bug report Affected Package "@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "~9.1.7", "@angular/compiler-cli": "~9.1.9", Is this a regression? I don't think so... Description When using more complex calculations in CSS cal...
Open Graph Description: 🐞 bug report Affected Package "@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "~9.1.7", "@angular/compiler-cli": "~9.1.9", Is this a regression? I don't think so... Description When us...
X Description: 🐞 bug report Affected Package "@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "~9.1.7", "@angular/compiler-cli": "~9.1.9", I...
Opengraph URL: https://github.com/angular/angular-cli/issues/17890
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using more complex calculations in CSS calc expressions will be incorrect in production builds","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n \"@angular-devkit/build-angular\": \"~0.901.7\",\r\n \"@angular/cli\": \"~9.1.7\",\r\n \"@angular/compiler-cli\": \"~9.1.9\",\r\n\r\n\r\n### Is this a regression?\r\nI don't think so...\r\n\r\n### Description\r\nWhen using more complex calculations in CSS `calc` expressions, production builds will be incorrect. Have look at the sample repo:\r\n\r\nI have added the following to `styles.css`:\r\n\r\n```css\r\n:root {\r\n --width-a: 10em;\r\n}\r\n.box {\r\n background-color: #ccc;\r\n width: calc(var(--width-a)/2 + var(--width-a)/2);\r\n height: calc(var(--width-a)/2 + var(--width-a)/2);\r\n}\r\n```\r\nwhich gets compiled to the following in production builds (`ng build --prod`):\r\n\r\n```css\r\n.box {\r\n background-color: #ccc;\r\n width: calc(var(--width-a) + var(--width-a));\r\n height: calc(var(--width-a) + var(--width-a));\r\n}\r\n```\r\n\r\nI think the problem comes from: https://github.com/postcss/postcss-calc/issues/107. But not sure if this plugin is used under the hood.\r\nUnfortunately we cannot disable specific PostCSS plugins: https://github.com/angular/angular-cli/issues/8427\r\n\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\nSee: https://github.com/loxy/angular-cs-calc-bug\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre\u003e\u003ccode\u003e\r\nAngular CLI: 9.1.7\r\nNode: 12.12.0\r\nOS: win32 x64\r\n\r\nAngular: 9.1.9\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.901.7\r\n@angular-devkit/build-angular 0.901.7\r\n@angular-devkit/build-optimizer 0.901.7\r\n@angular-devkit/build-webpack 0.901.7\r\n@angular-devkit/core 9.1.7\r\n@angular-devkit/schematics 9.1.7\r\n@angular/cli 9.1.7\r\n@ngtools/webpack 9.1.7\r\n@schematics/angular 9.1.7\r\n@schematics/update 0.901.7\r\nrxjs 6.5.5\r\ntypescript 3.8.3\r\nwebpack 4.42.0\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n**Anything else relevant?**\r\nNo\r\n","author":{"url":"https://github.com/loxy","@type":"Person","name":"loxy"},"datePublished":"2020-06-09T09:35:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17890/angular-cli/issues/17890"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a23bea2b-dc8b-01f4-81b3-e5cc56b45eb6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8CBA:395ACD:331B5ED:49C0BFE:6A60E843 |
| html-safe-nonce | 86b6d34a1decb726751de5c2d945d60deeebde777a4f71d3ea62433833d62b6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0JBOjM5NUFDRDozMzFCNUVEOjQ5QzBCRkU6NkE2MEU4NDMiLCJ2aXNpdG9yX2lkIjoiNzA0ODYyNTU1NzQ0NzE3NDIxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a9470177de18eda37d815e0aa00222ff35346c7334342887439b7283d9557935 |
| hovercard-subject-tag | issue:635327318 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/17890/issue_layout |
| twitter:image | https://opengraph.githubassets.com/565b3ca8c056e13225c98fc148cc051c23912a35626c75ee7bf841fdd9128fe5/angular/angular-cli/issues/17890 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/565b3ca8c056e13225c98fc148cc051c23912a35626c75ee7bf841fdd9128fe5/angular/angular-cli/issues/17890 |
| og:image:alt | 🐞 bug report Affected Package "@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "~9.1.7", "@angular/compiler-cli": "~9.1.9", Is this a regression? I don't think so... Description When us... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | loxy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3ba36a464b9464992131f4003292a219fc87f92404b0dbe3fd1ef07f11102d0f |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2cc5e4f897a27632dd600edfec4c737bea2f8338 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width