{"action":"opened","issue":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-cssmin/issues/215","labels_url":"https://api.github.com/repos/gruntjs/grunt-contrib-cssmin/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/gruntjs/grunt-contrib-cssmin/issues/215/comments","events_url":"https://api.github.com/repos/gruntjs/grunt-contrib-cssmin/issues/215/events","html_url":"https://github.com/gruntjs/grunt-contrib-cssmin/issues/215","id":75761939,"number":215,"title":"Convert # css color to named color when minifying","user":{"login":"smithery","id":10107801,"avatar_url":"https://avatars.githubusercontent.com/u/10107801?v=3","gravatar_id":"","url":"https://api.github.com/users/smithery","html_url":"https://github.com/smithery","followers_url":"https://api.github.com/users/smithery/followers","following_url":"https://api.github.com/users/smithery/following{/other_user}","gists_url":"https://api.github.com/users/smithery/gists{/gist_id}","starred_url":"https://api.github.com/users/smithery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smithery/subscriptions","organizations_url":"https://api.github.com/users/smithery/orgs","repos_url":"https://api.github.com/users/smithery/repos","events_url":"https://api.github.com/users/smithery/events{/privacy}","received_events_url":"https://api.github.com/users/smithery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-12T22:28:02Z","updated_at":"2015-05-12T22:28:02Z","closed_at":null,"body":"If you have in your css\r\n\r\n color: #ff0000;\r\n color: #00ff00;\r\n color:#0f0;\r\n\r\n and then minify the css, the value is converted to\r\n\r\n color:red;\r\n color:green;\r\n color:green;\r\n\r\n While this may make readability sense, it probably makes no programmatic sense on two levels: 1) depending on the color, the result is actually larger (defeats the minify) and you can't easily read it as your css is not effectively one line; 2) at the browser level, I would imagine the lookup mechanism for the color would be slower than if the hex number is used (I have no insight as to if this is true, however, just thinking about it, the coding would be faster and smaller for the hex conversion which the name color has to be converted to anyways).\r\n\r\nRegarding the second case, I had an email discussion with an engineer who was able to test the parsing performance of the css and noted that parsing of the hex value was significantly faster than the named color. I would suggest either creating a mechanism to allow the exact color to be used rather than conversion. Please remember, that the css file can be cached on the client side so the download is no longer a factor. The parsing of the file now becomes the issue."}}