{"action":"opened","issue":{"url":"https://api.github.com/repos/MoOx/postcss-cssnext/issues/324","repository_url":"https://api.github.com/repos/MoOx/postcss-cssnext","labels_url":"https://api.github.com/repos/MoOx/postcss-cssnext/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/MoOx/postcss-cssnext/issues/324/comments","events_url":"https://api.github.com/repos/MoOx/postcss-cssnext/issues/324/events","html_url":"https://github.com/MoOx/postcss-cssnext/issues/324","id":185747825,"number":324,"title":"Preserve custom properties not working.","user":{"login":"sunglee","id":38310,"avatar_url":"https://avatars.githubusercontent.com/u/38310?v=3","gravatar_id":"","url":"https://api.github.com/users/sunglee","html_url":"https://github.com/sunglee","followers_url":"https://api.github.com/users/sunglee/followers","following_url":"https://api.github.com/users/sunglee/following{/other_user}","gists_url":"https://api.github.com/users/sunglee/gists{/gist_id}","starred_url":"https://api.github.com/users/sunglee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunglee/subscriptions","organizations_url":"https://api.github.com/users/sunglee/orgs","repos_url":"https://api.github.com/users/sunglee/repos","events_url":"https://api.github.com/users/sunglee/events{/privacy}","received_events_url":"https://api.github.com/users/sunglee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-27T18:38:52Z","updated_at":"2016-10-27T18:38:52Z","closed_at":null,"body":"Based on the documentation, it says you can preserve custom properties when exporting.\r\n\r\nFor example, from the following code:\r\n```css\r\n//postcss\r\n:root {\r\n  --color-main: #f00;\r\n}\r\n\r\n.button {\r\n  background: var(--color-main);\r\n}\r\n```\r\n\r\nWhat I expected was:\r\n```css\r\n.button {\r\n  background: #f00;\r\n  background: var(--color-main);\r\n}\r\n```\r\n\r\nWhat I got after processing was without preserving custom properties:\r\n```css\r\n.button {\r\n  background: #f00;\r\n}\r\n```\r\n\r\nI have a following gulp task:\r\n```js\r\ngulp.task('styles', () => {\r\n  const processors = [\r\n    cssnext({\r\n      features: {\r\n        customProperties: {\r\n          preserve: true,\r\n          appendVariables: true\r\n        }\r\n      }\r\n    }),\r\n  ];\r\n  return gulp.src(['*.css'\r\n  ])\r\n    .pipe(postcss(processors))\r\n    .pipe(gulp.dest('.tmp/css'));\r\n});\r\n```\r\n\r\nAnything I am missing? Thanks for your comments."}}
{"actor":{"display_login":"sunglee"}}