{"action":"created","issue":{"url":"https://api.github.com/repos/sass/libsass/issues/548","labels_url":"https://api.github.com/repos/sass/libsass/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/sass/libsass/issues/548/comments","events_url":"https://api.github.com/repos/sass/libsass/issues/548/events","html_url":"https://github.com/sass/libsass/issues/548","id":46101800,"number":548,"title":"Support parent selector & in values / and/or interpolations","user":{"login":"gionkunz","id":2203704,"avatar_url":"https://avatars.githubusercontent.com/u/2203704?v=3","gravatar_id":"","url":"https://api.github.com/users/gionkunz","html_url":"https://github.com/gionkunz","followers_url":"https://api.github.com/users/gionkunz/followers","following_url":"https://api.github.com/users/gionkunz/following{/other_user}","gists_url":"https://api.github.com/users/gionkunz/gists{/gist_id}","starred_url":"https://api.github.com/users/gionkunz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gionkunz/subscriptions","organizations_url":"https://api.github.com/users/gionkunz/orgs","repos_url":"https://api.github.com/users/gionkunz/repos","events_url":"https://api.github.com/users/gionkunz/events{/privacy}","received_events_url":"https://api.github.com/users/gionkunz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sass/libsass/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/sass/libsass/labels/test+written","name":"test written","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2014-10-17T13:55:12Z","updated_at":"2015-01-21T08:56:25Z","closed_at":null,"body":"Hi \r\n\r\nFirst I'd like to thank you for your awesome work! \r\n\r\nI've put together a small BEM Sass library http://codepen.io/gionkunz/pen/rkswl and there are problems in libsass with the parent selector. It looks like there is an undocumented feature in RubySass that the parent selector & can also be converted to a selector string. I believe internally its a list of lists if I'm not mistaken. So in `.test { .abc, .def { &:before { content: \".\" } } }`  & would be stored as list of lists `( ( \".test .abc\" ) , (\".test .def\") )`. In RubySass when the parent selector `&` appears where a value is expected it gets converted to a string http://sass-lang.com/documentation/Sass/Script/Functions.html#selector_functions .\r\n\r\n```css\r\n.parent-sel-value {\r\n  font-family: &;\r\n  .parent-sel-interpolation {\r\n    font-family: #{&};\r\n     .parent-sel-value-concat {\r\n        font-family: \"Current parent: \" + &;\r\n     }\r\n  }\r\n}\r\n```\r\n\r\nGets processed to:\r\n\r\n```css\r\n.parent-sel-value {\r\n  font-family: .parent-sel-value;\r\n}\r\n.parent-sel-value .parent-sel-interpolation {\r\n  font-family: .parent-sel-value .parent-sel-interpolation;\r\n}\r\n.parent-sel-value .parent-sel-interpolation .parent-sel-value-concat {\r\n  font-family: \"Current parent: .parent-sel-value .parent-sel-interpolation .parent-sel-value-concat\";\r\n}\r\n```\r\n\r\nThis feature is particularly interesting for libraries and frameworks that need to have more control over selectors during nesting. I'd really love to have this in libsass too. \r\n\r\nI did not find any spec in https://github.com/sass/sass-spec concerning this undocumented feature and I'd also help where I can to get this in.\r\n\r\nCheers\r\nGion\r\n\r\n\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/5348667-support-parent-selector-in-values-and-or-interpolations?utm_campaign=plugin&utm_content=tracker%2F283068&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F283068&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/sass/libsass/issues/comments/70803874","html_url":"https://github.com/sass/libsass/issues/548#issuecomment-70803874","issue_url":"https://api.github.com/repos/sass/libsass/issues/548","id":70803874,"user":{"login":"xzyfer","id":579928,"avatar_url":"https://avatars.githubusercontent.com/u/579928?v=3","gravatar_id":"","url":"https://api.github.com/users/xzyfer","html_url":"https://github.com/xzyfer","followers_url":"https://api.github.com/users/xzyfer/followers","following_url":"https://api.github.com/users/xzyfer/following{/other_user}","gists_url":"https://api.github.com/users/xzyfer/gists{/gist_id}","starred_url":"https://api.github.com/users/xzyfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xzyfer/subscriptions","organizations_url":"https://api.github.com/users/xzyfer/orgs","repos_url":"https://api.github.com/users/xzyfer/repos","events_url":"https://api.github.com/users/xzyfer/events{/privacy}","received_events_url":"https://api.github.com/users/xzyfer/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T08:56:25Z","updated_at":"2015-01-21T08:56:25Z","body":"Exactly. Only the expand visitor know how to hydrate the `&` expression. My\r\ngut feeling is you'll need a new `Expression ` subclass node in the mix.\r\nOn 21 Jan 2015 19:47, \"Eric Kimn\" <notifications@github.com> wrote:\r\n\r\n> Ah, that's what you mean by the stacks being different...the eval visitor\r\n> is for expressions primarily and the expand visitor is primarily for\r\n> Statements?\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/sass/libsass/issues/548#issuecomment-70802776>.\r\n>"}}