{"action":"created","issue":{"url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/10","labels_url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/10/comments","events_url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/10/events","html_url":"https://github.com/postcss/postcss-simple-vars/issues/10","id":68219267,"number":10,"title":"How can I access variables in JS?","user":{"login":"corysimmons","id":224636,"avatar_url":"https://avatars.githubusercontent.com/u/224636?v=3","gravatar_id":"","url":"https://api.github.com/users/corysimmons","html_url":"https://github.com/corysimmons","followers_url":"https://api.github.com/users/corysimmons/followers","following_url":"https://api.github.com/users/corysimmons/following{/other_user}","gists_url":"https://api.github.com/users/corysimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/corysimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corysimmons/subscriptions","organizations_url":"https://api.github.com/users/corysimmons/orgs","repos_url":"https://api.github.com/users/corysimmons/repos","events_url":"https://api.github.com/users/corysimmons/events{/privacy}","received_events_url":"https://api.github.com/users/corysimmons/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-13T23:35:53Z","updated_at":"2015-04-13T23:47:59Z","closed_at":"2015-04-13T23:38:11Z","body":"```css\r\n$gutter: 30px;\r\n\r\n.foo {\r\n  column: 1/2;\r\n}\r\n```\r\n\r\n```javascript\r\nvar postcss = require('postcss'),\r\n    autoprefixer = require('autoprefixer'),\r\n    simpleVars = require('postcss-simple-vars'),\r\n    fs = require('fs');\r\n\r\n\r\nvar lost = postcss.plugin('lost', function() {\r\n  return function (css, processor) {\r\n    css.eachDecl('column', function (decl) {\r\n      console.log($gutter); // how can I access this variable?\r\n      decl.cloneBefore({ prop: 'float', value: 'left' });\r\n      decl.cloneBefore({ prop: 'margin-right', value: '20px' });\r\n      decl.cloneBefore({ prop: 'width', value: 'calc(100% * '+ decl.value +')' });\r\n      decl.removeSelf();\r\n    });\r\n  };\r\n});\r\n\r\nvar processor = postcss([autoprefixer, simpleVars, lost]);\r\n\r\nprocessor.process(fs.readFileSync('app.css'), {\r\n  from: 'app.css',\r\n  to: 'app.out.css'\r\n}).then(function (result) {\r\n\r\n  console.log(result.css)\r\n  fs.writeFileSync('app.out.css', result.css);\r\n\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/comments/92538389","html_url":"https://github.com/postcss/postcss-simple-vars/issues/10#issuecomment-92538389","issue_url":"https://api.github.com/repos/postcss/postcss-simple-vars/issues/10","id":92538389,"user":{"login":"ai","id":19343,"avatar_url":"https://avatars.githubusercontent.com/u/19343?v=3","gravatar_id":"","url":"https://api.github.com/users/ai","html_url":"https://github.com/ai","followers_url":"https://api.github.com/users/ai/followers","following_url":"https://api.github.com/users/ai/following{/other_user}","gists_url":"https://api.github.com/users/ai/gists{/gist_id}","starred_url":"https://api.github.com/users/ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ai/subscriptions","organizations_url":"https://api.github.com/users/ai/orgs","repos_url":"https://api.github.com/users/ai/repos","events_url":"https://api.github.com/users/ai/events{/privacy}","received_events_url":"https://api.github.com/users/ai/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T23:47:59Z","updated_at":"2015-04-13T23:47:59Z","body":"See postcss-flexgrid API for example. It creates same grid:  https://github.com/area17/postcss-flexgrid"}}