{"action":"created","issue":{"url":"https://api.github.com/repos/stylus/stylus/issues/1924","labels_url":"https://api.github.com/repos/stylus/stylus/issues/1924/labels{/name}","comments_url":"https://api.github.com/repos/stylus/stylus/issues/1924/comments","events_url":"https://api.github.com/repos/stylus/stylus/issues/1924/events","html_url":"https://github.com/stylus/stylus/issues/1924","id":79356864,"number":1924,"title":"Auto merging equal selectors and attributes inside selectors","user":{"login":"ryrun","id":1203821,"avatar_url":"https://avatars.githubusercontent.com/u/1203821?v=3","gravatar_id":"","url":"https://api.github.com/users/ryrun","html_url":"https://github.com/ryrun","followers_url":"https://api.github.com/users/ryrun/followers","following_url":"https://api.github.com/users/ryrun/following{/other_user}","gists_url":"https://api.github.com/users/ryrun/gists{/gist_id}","starred_url":"https://api.github.com/users/ryrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryrun/subscriptions","organizations_url":"https://api.github.com/users/ryrun/orgs","repos_url":"https://api.github.com/users/ryrun/repos","events_url":"https://api.github.com/users/ryrun/events{/privacy}","received_events_url":"https://api.github.com/users/ryrun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-22T08:40:07Z","updated_at":"2015-05-22T10:09:52Z","closed_at":"2015-05-22T10:09:52Z","body":"I've a feature request. What about auto merging selectors to remove redundancy for the output css file? As far as i know, there shouldn't be any problems, when the last declaration will be used. Atleast the selector is 100% equal.\r\n\r\nExample:\r\n\r\nFrom:\r\n```stylus\r\n.button\r\n   color: red\r\n.special .button\r\n   font-size: 32px\r\n.button\r\n   font-family: Arial\r\n```\r\nTo:\r\n```css\r\n.special .button {\r\n   font-size: 32px\r\n}\r\n.button {\r\n   color: red;\r\n   font-family: Arial\r\n}\r\n```\r\n\r\nMaybe it could also merge attributes inside selectors and take care of the important tag:\r\n\r\nExample:\r\n\r\nFrom:\r\n```stylus\r\n.button\r\n   color: red;\r\n.button\r\n   color: blue;\r\n.button2\r\n   color: red!important;\r\n.button2\r\n   color: blue;\r\n```\r\nTo:\r\n```css\r\n.button {\r\n   color: blue;\r\n}\r\n.button2 {\r\n   color: red!important;\r\n}\r\n```\r\n\r\nI know, stylus is not a compressor, but it parse the source anyway, so i think it could easily take care of it. It would be a really nice feature, when i reuse stylus files for several projects."},"comment":{"url":"https://api.github.com/repos/stylus/stylus/issues/comments/104607797","html_url":"https://github.com/stylus/stylus/issues/1924#issuecomment-104607797","issue_url":"https://api.github.com/repos/stylus/stylus/issues/1924","id":104607797,"user":{"login":"Panya","id":235637,"avatar_url":"https://avatars.githubusercontent.com/u/235637?v=3","gravatar_id":"","url":"https://api.github.com/users/Panya","html_url":"https://github.com/Panya","followers_url":"https://api.github.com/users/Panya/followers","following_url":"https://api.github.com/users/Panya/following{/other_user}","gists_url":"https://api.github.com/users/Panya/gists{/gist_id}","starred_url":"https://api.github.com/users/Panya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Panya/subscriptions","organizations_url":"https://api.github.com/users/Panya/orgs","repos_url":"https://api.github.com/users/Panya/repos","events_url":"https://api.github.com/users/Panya/events{/privacy}","received_events_url":"https://api.github.com/users/Panya/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T10:09:51Z","updated_at":"2015-05-22T10:09:51Z","body":"Yep, there is better tools for this (like [CSSO](https://github.com/css/csso) or [cssnano](https://github.com/ben-eb/cssnano))."}}