{"action":"created","issue":{"url":"https://api.github.com/repos/postcss/postcss-calc/issues/30","repository_url":"https://api.github.com/repos/postcss/postcss-calc","labels_url":"https://api.github.com/repos/postcss/postcss-calc/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/postcss/postcss-calc/issues/30/comments","events_url":"https://api.github.com/repos/postcss/postcss-calc/issues/30/events","html_url":"https://github.com/postcss/postcss-calc/issues/30","id":165912071,"number":30,"title":"Using postcss-calc inside postcss-strip-units","user":{"login":"RyoIkarashi","id":5750408,"avatar_url":"https://avatars.githubusercontent.com/u/5750408?v=3","gravatar_id":"","url":"https://api.github.com/users/RyoIkarashi","html_url":"https://github.com/RyoIkarashi","followers_url":"https://api.github.com/users/RyoIkarashi/followers","following_url":"https://api.github.com/users/RyoIkarashi/following{/other_user}","gists_url":"https://api.github.com/users/RyoIkarashi/gists{/gist_id}","starred_url":"https://api.github.com/users/RyoIkarashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyoIkarashi/subscriptions","organizations_url":"https://api.github.com/users/RyoIkarashi/orgs","repos_url":"https://api.github.com/users/RyoIkarashi/repos","events_url":"https://api.github.com/users/RyoIkarashi/events{/privacy}","received_events_url":"https://api.github.com/users/RyoIkarashi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-16T06:08:45Z","updated_at":"2016-07-18T04:43:19Z","closed_at":"2016-07-18T04:43:19Z","body":"When I put `calc()` function inside `strip()`, I get an error saying `Couldn't parse strip(calc(24px * 2)). Got NaN`.\r\n\r\nI think this error occurs because `postcss-strip-units` is added before `postcss-calc`.\r\nSo I added postcss-calc twice before and after `postcss-strip-units`, but unfortunately it didn't work at all.\r\n\r\nAny idea to achieve this or workaround?\r\n\r\nThe code is something like below.\r\n\r\nvariables.css\r\n```css\r\n:root {\r\n    --a-size: 24px;\r\n    --b-size: calc(var(--a-size) * 2);\r\n}\r\n```\r\n\r\ntype.css\r\n```css\r\nh1 {\r\n    font-size: calc(strip(var(--b-size)) * 1 rem); /* => Couldn't parse strip(calc(24px * 2)) => NaN */\r\n}\r\n```\r\n\r\nmain.css\r\n```css\r\n@import 'variables.css';\r\n@import 'type.css';\r\n```\r\n\r\nPostCSS plugins order\r\n```\r\nrequire('postcss-devtools')(),\r\nrequire('postcss-easy-import')({addDependencyTo: webpack,prefix: '_'}),\r\nrequire('postcss-url')(),\r\nrequire('postcss-mixins')(),\r\nrequire('postcss-extend')(),\r\nrequire('postcss-each')(),\r\nrequire('postcss-for')(),\r\nrequire('postcss-nth-list')(),\r\nrequire('postcss-simple-vars')(),\r\nrequire('postcss-custom-properties')(),\r\nrequire('postcss-strip-units')(),\r\nrequire('postcss-conditionals')(),\r\nrequire('postcss-calc')({warnWhenCannotResolve: true}),\r\nrequire('postcss-cssnext')({browsers: 'last 2 versions'}),\r\nrequire('css-mqpacker')(),\r\nrequire('postcss-utilities')(),\r\nrequire('postcss-browser-reporter')(),\r\nrequire('postcss-reporter')()\r\n```"},"comment":{"url":"https://api.github.com/repos/postcss/postcss-calc/issues/comments/233227834","html_url":"https://github.com/postcss/postcss-calc/issues/30#issuecomment-233227834","issue_url":"https://api.github.com/repos/postcss/postcss-calc/issues/30","id":233227834,"user":{"login":"MoOx","id":157534,"avatar_url":"https://avatars.githubusercontent.com/u/157534?v=3","gravatar_id":"","url":"https://api.github.com/users/MoOx","html_url":"https://github.com/MoOx","followers_url":"https://api.github.com/users/MoOx/followers","following_url":"https://api.github.com/users/MoOx/following{/other_user}","gists_url":"https://api.github.com/users/MoOx/gists{/gist_id}","starred_url":"https://api.github.com/users/MoOx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoOx/subscriptions","organizations_url":"https://api.github.com/users/MoOx/orgs","repos_url":"https://api.github.com/users/MoOx/repos","events_url":"https://api.github.com/users/MoOx/events{/privacy}","received_events_url":"https://api.github.com/users/MoOx/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T04:43:18Z","updated_at":"2016-07-18T04:43:18Z","body":"Sorry but there is no easy fix or workaround for this.\r\nYou should not try to mix unofficial and optimisation stuff. Also what you are doing seems like a bad idea. Maybe try to write your own plugin instead."}}
{"actor":{"display_login":"MoOx"}}