{"action":"created","issue":{"url":"https://api.github.com/repos/HugoGiraudel/ama/issues/26","labels_url":"https://api.github.com/repos/HugoGiraudel/ama/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/HugoGiraudel/ama/issues/26/comments","events_url":"https://api.github.com/repos/HugoGiraudel/ama/issues/26/events","html_url":"https://github.com/HugoGiraudel/ama/issues/26","id":96919339,"number":26,"title":"PostCSS","user":{"login":"HoBi","id":5287596,"avatar_url":"https://avatars.githubusercontent.com/u/5287596?v=3","gravatar_id":"","url":"https://api.github.com/users/HoBi","html_url":"https://github.com/HoBi","followers_url":"https://api.github.com/users/HoBi/followers","following_url":"https://api.github.com/users/HoBi/following{/other_user}","gists_url":"https://api.github.com/users/HoBi/gists{/gist_id}","starred_url":"https://api.github.com/users/HoBi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoBi/subscriptions","organizations_url":"https://api.github.com/users/HoBi/orgs","repos_url":"https://api.github.com/users/HoBi/repos","events_url":"https://api.github.com/users/HoBi/events{/privacy}","received_events_url":"https://api.github.com/users/HoBi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T22:37:02Z","updated_at":"2015-07-27T15:48:01Z","closed_at":null,"body":"Well, what do you think about PostCSS?\r\n\r\nA lot of people say \"write future CSS\" and the post-processing itself is mentioned like the sentence, but if you look at the plugins, a lot of them are written like for pre-processor use, which is kind of strange...\r\n\r\nWhat do you like (and do not like) about the idea of PostCSS compared with Sass?\r\n\r\nDo you think about move to PostCSS?"},"comment":{"url":"https://api.github.com/repos/HugoGiraudel/ama/issues/comments/125250695","html_url":"https://github.com/HugoGiraudel/ama/issues/26#issuecomment-125250695","issue_url":"https://api.github.com/repos/HugoGiraudel/ama/issues/26","id":125250695,"user":{"login":"HugoGiraudel","id":1889710,"avatar_url":"https://avatars.githubusercontent.com/u/1889710?v=3","gravatar_id":"","url":"https://api.github.com/users/HugoGiraudel","html_url":"https://github.com/HugoGiraudel","followers_url":"https://api.github.com/users/HugoGiraudel/followers","following_url":"https://api.github.com/users/HugoGiraudel/following{/other_user}","gists_url":"https://api.github.com/users/HugoGiraudel/gists{/gist_id}","starred_url":"https://api.github.com/users/HugoGiraudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HugoGiraudel/subscriptions","organizations_url":"https://api.github.com/users/HugoGiraudel/orgs","repos_url":"https://api.github.com/users/HugoGiraudel/repos","events_url":"https://api.github.com/users/HugoGiraudel/events{/privacy}","received_events_url":"https://api.github.com/users/HugoGiraudel/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T15:48:01Z","updated_at":"2015-07-27T15:48:01Z","body":"Hey Honza.\r\n\r\nAs far as I can tell, PostCSS is just an engine to post-treat stylesheets, in the way that it doesn't do anything in itself, until you start using plugins. Some of them are really handy, such as Autoprefixer. I feel like this is typically the kind of scenario where post-treating CSS makes sense.\r\n\r\nNow regarding using PostCSS or cssnext as a replacement for Sass in my daily workflow, I don't see it happening soon. For starters, PostCSS would not solve any problem that Sass doesn't solve for me yet so no need to change something that works fine.\r\n\r\nSecondly, there are things that I don't like about polyfilling the future CSS syntax: it cannot be done. At least not efficiently. The whole idea behind this comes from Babel and other JavaScript transpilers, polyfilling future JS syntax with JavaScript. Then people thought “let's polyfill future CSS syntax with JavaScript as well”. Unfortunately it is not that simple and more often than not it cannot be done at all.\r\n\r\nThe thing is, CSS is heavily related to context. The same code snippet will have a completely different impact depending on the DOM structure, the browser, and a couple of other factors. That means you cannot really understand CSS outside of the browser rendering frame. Because of this, you cannot truly polyfill future syntax with JavaScript. Because it's not JavaScript that is needed to do so; it's a rendering engine. Take `calc(100% - 200px)` for instance. Only the browser is able to compute the resulting value, because it knows how to convert `100%` in pixels. \r\n\r\nNow, CSS variables. They cannot be polyfilled with JavaScript. Because they are not CSS variables. They are custom properties. The strength of this feature is not to avoid a search and replace like preprocessors variables. The strength of CSS CP is to follow the cascade, to be inherited, to be updated on-the-fly, and so on. PostCSS and the like polyfill what they can of the spec of Custom Properties; which is not only a very fraction of it, but also —I believe— extremely misleading. \r\n\r\nSome developers using PostCSS without being very aware of the specifications of the Custom Properties are likely to believe that they are just variables, because that's basically what PostCSS can offer from the spec. And they will probably never know there is so much more to them than avoiding to perform a search and replace in the IDE when changing a value. In that way, I wonder whether it actually helps the community. I believe I prefer no polyfill than a half-baked one, but that's probably only my opinion.\r\n\r\nAnyway. I like the idea, but I think we are pushing it too far, where it doesn't belong. And when you think about it, preprocessors do not really have this problem, as people know that Sass/LESS/Stylus syntax is proprietary, features are proprietary and this is not going to be implemented as is in the CSS language. Nobody will ever be confused about the mixin directive or the dollar variables. They are Sass features, working as intended per Sass documentation. No surprise.\r\n\r\nI don't like surprise. Especially in my code. "}}