{"action":"created","issue":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/414","labels_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/414/labels{/name}","comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/414/comments","events_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/414/events","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/414","id":52601487,"number":414,"title":"Source map and selectors","user":{"login":"unlok","id":3048454,"avatar_url":"https://avatars.githubusercontent.com/u/3048454?v=3","gravatar_id":"","url":"https://api.github.com/users/unlok","html_url":"https://github.com/unlok","followers_url":"https://api.github.com/users/unlok/followers","following_url":"https://api.github.com/users/unlok/following{/other_user}","gists_url":"https://api.github.com/users/unlok/gists{/gist_id}","starred_url":"https://api.github.com/users/unlok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unlok/subscriptions","organizations_url":"https://api.github.com/users/unlok/orgs","repos_url":"https://api.github.com/users/unlok/repos","events_url":"https://api.github.com/users/unlok/events{/privacy}","received_events_url":"https://api.github.com/users/unlok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/milestones/32","labels_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/milestones/32/labels","id":934245,"number":32,"title":"3.0.5","description":null,"creator":{"login":"jakubpawlowicz","id":24273,"avatar_url":"https://avatars.githubusercontent.com/u/24273?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubpawlowicz","html_url":"https://github.com/jakubpawlowicz","followers_url":"https://api.github.com/users/jakubpawlowicz/followers","following_url":"https://api.github.com/users/jakubpawlowicz/following{/other_user}","gists_url":"https://api.github.com/users/jakubpawlowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubpawlowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubpawlowicz/subscriptions","organizations_url":"https://api.github.com/users/jakubpawlowicz/orgs","repos_url":"https://api.github.com/users/jakubpawlowicz/repos","events_url":"https://api.github.com/users/jakubpawlowicz/events{/privacy}","received_events_url":"https://api.github.com/users/jakubpawlowicz/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2015-01-13T22:24:44Z","updated_at":"2015-01-14T19:05:17Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2014-12-21T17:54:42Z","updated_at":"2015-01-15T21:47:48Z","closed_at":null,"body":"CSS and source-map from previous step:\r\n\r\n### Set 1\r\ncss:\r\n```css\r\na,\r\na:hover,\r\na:visited\r\n{\r\n    color: red;\r\n}\r\n```\r\n\r\nmappings:\r\n```json\r\n{\"version\":3,\"sources\":[\"index.css\"],\"names\":[],\"mappings\":\"AAAA;;;;IAII,YAAW;EACd\"}\r\n```\r\n\r\nvisual:\r\n```\r\n[a,\r\na:hover,\r\na:visited\r\n{\r\n    ][color: red;]\r\n[}]\r\n```\r\n\r\n### Set 2\r\n\r\n*Like above but selectors written to one line.*\r\n\r\ncss:\r\n```css\r\na, a:hover, a:visited\r\n{\r\n    color: red;\r\n}\r\n```\r\n\r\nmappings:\r\n```json\r\n{\"version\":3,\"sources\":[\"index.css\"],\"names\":[],\"mappings\":\"AAAA;;IAEI,YAAW;EACd\"}\r\n```\r\nvisual:\r\n```\r\n[a, a:hover, a:visited\r\n{\r\n    ][color: red;]\r\n[}]\r\n```\r\n\r\nI try to load this same sets and optimize it, but correct source-map will generated only for `Set 2`.\r\n\r\nFor `Set 2` (good mappings).\r\n```js\r\nnew CleanCSS({sourceMap: 'form set 2'}).minify('from set 2');\r\n```\r\n\r\nmappings:\r\n```json\r\n{\"version\":3,\"sources\":[\"index.css\"],\"names\":[],\"mappings\":\"AAAA,EAAG,QAAS,UAER\"}\r\n```\r\n\r\nFor `Set 1` (bad mappings).\r\n```js\r\nnew CleanCSS({sourceMap: 'form set 1'}).minify('from set 1');\r\n```\r\n\r\nmappings:\r\n```json\r\n{\"version\":3,\"sources\":[\"index.css\",\"__stdin__.css\"],\"names\":[],\"mappings\":\"AAAA,ECCA,QACA,UDEI\"}\r\n```\r\n\r\nWhy `__stdin__.css` source appeared?"},"comment":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/comments/70168354","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/414#issuecomment-70168354","issue_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/414","id":70168354,"user":{"login":"jakubpawlowicz","id":24273,"avatar_url":"https://avatars.githubusercontent.com/u/24273?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubpawlowicz","html_url":"https://github.com/jakubpawlowicz","followers_url":"https://api.github.com/users/jakubpawlowicz/followers","following_url":"https://api.github.com/users/jakubpawlowicz/following{/other_user}","gists_url":"https://api.github.com/users/jakubpawlowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubpawlowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubpawlowicz/subscriptions","organizations_url":"https://api.github.com/users/jakubpawlowicz/orgs","repos_url":"https://api.github.com/users/jakubpawlowicz/repos","events_url":"https://api.github.com/users/jakubpawlowicz/events{/privacy}","received_events_url":"https://api.github.com/users/jakubpawlowicz/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T21:47:47Z","updated_at":"2015-01-15T21:47:47Z","body":"@unlok 5dd3e068fc994b12415c7ae9b7d9f1a585310e6b should fix the issue for you - would you be able to give it a try before I push 3.0.5 out?"}}