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:75e5e305-30cd-d43d-85f5-a2eede12c45b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E77A:3D075F:1C700E:26167D:6A61302B |
| html-safe-nonce | 65ef93152a1fef5f144058a4b2d3a76b60801f6c16414fdc4874a0689ffddc6f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzdBOjNEMDc1RjoxQzcwMEU6MjYxNjdEOjZBNjEzMDJCIiwidmlzaXRvcl9pZCI6IjQyOTE1ODE3MDgyMDkzMDM1OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a9a90a336f8f4e1819882f0880ccf329f754a959b6102180350b100c6f98aeaf |
| 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 | c5eca2d5d770261725d2d44a57879a5bd9643e5b84204081dc36933ab40e63a2 |
| 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 | dac3a1c903b48538720e0bc780047237dd89fd4c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width