{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2101","labels_url":"https://api.github.com/repos/less/less.js/issues/2101/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2101/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2101/events","html_url":"https://github.com/less/less.js/issues/2101","id":37522779,"number":2101,"title":"The proposed feature set for :extend","user":{"login":"matthew-dean","id":414752,"avatar_url":"https://avatars.githubusercontent.com/u/414752?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-dean","html_url":"https://github.com/matthew-dean","followers_url":"https://api.github.com/users/matthew-dean/followers","following_url":"https://api.github.com/users/matthew-dean/following{/other_user}","gists_url":"https://api.github.com/users/matthew-dean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-dean/subscriptions","organizations_url":"https://api.github.com/users/matthew-dean/orgs","repos_url":"https://api.github.com/users/matthew-dean/repos","events_url":"https://api.github.com/users/matthew-dean/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-dean/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/less/less.js/labels/Feature%20Request","name":"Feature Request","color":"fe9400"},{"url":"https://api.github.com/repos/less/less.js/labels/ReadyForImplementation","name":"ReadyForImplementation","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-07-10T00:45:50Z","updated_at":"2015-02-04T17:55:24Z","closed_at":null,"body":"On issue #1155, there was community consensus on the usage of extend in a way that offered flexibility for different use cases but kept things simple through the use of keyword flags. I've pulled out the relevant section/syntax that was agreed upon:\r\n\r\n### :extend( *selector* [exact|any] [shallow|deep] [all])\r\n* **exact** [default] - Match complete selectors (```:extend(.button exact)``` matches ```.button {}``` but not ```#main .button a``` - **```:extend(.a .b)``` is considered an exact match to ```.a { .b { } }```)**\r\n* **any** - Match partial selector (```:extend(.button any)``` matches ```.button {}``` **and** ```#main .button a```)\r\n* **shallow** [default] - extend only root properties (```.a:extend(.button shallow)``` will not include hover in ```.button { &:hover { } }```)\r\n* **deep** - extend all nested selectors/properties (```.a:extend(.button deep)``` **will** include hover in ```.button { &:hover { } }```)\r\n* **all** - set \"any\" and \"deep\" to true. Extend all matches, partial and exact, and extend all base and nested properties\r\n\r\n**Example:**\r\n```\r\n.b:extend(.a);  // because of defaults, exact=true, shallow=true\r\n.b:extend(.a any);  // exact=false, shallow=true\r\n.b:extend(.a deep);  //exact=true, shallow=false\r\n.b:extend(.a all); // exact=false, shallow=false\r\n```\r\n\r\nThe reasons, arguments, and use cases for these other uses of ```:extend``` are documented in issue #1155. After the discussion and consensus, the first case and last case were implemented because they were easier to implement first, but I think the remaining implementation got lost in the noise. I'd love to see the rest of ```:extend``` implemented as I think these other use cases are still valid and there's various issues that come up here that essentially relate to what's still missing. (See: less/less-docs#177).\r\n\r\nI'd love to see the work on ```:extend``` continue! (And other great ideas, like extending mixins.)"},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/72903887","html_url":"https://github.com/less/less.js/issues/2101#issuecomment-72903887","issue_url":"https://api.github.com/repos/less/less.js/issues/2101","id":72903887,"user":{"login":"matthew-dean","id":414752,"avatar_url":"https://avatars.githubusercontent.com/u/414752?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-dean","html_url":"https://github.com/matthew-dean","followers_url":"https://api.github.com/users/matthew-dean/followers","following_url":"https://api.github.com/users/matthew-dean/following{/other_user}","gists_url":"https://api.github.com/users/matthew-dean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-dean/subscriptions","organizations_url":"https://api.github.com/users/matthew-dean/orgs","repos_url":"https://api.github.com/users/matthew-dean/repos","events_url":"https://api.github.com/users/matthew-dean/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-dean/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T17:55:24Z","updated_at":"2015-02-04T17:55:24Z","body":"What do you think about supporting an (optional) exclamation point on flags for clarity / separation from element selectors?\r\n\r\n```\r\n.myarticle {\r\n  &:extend(section aside !all); \r\n}\r\n```\r\nI know our keywords don't conflict, but it might be intuitive for some because of ```!important```."}}