Ask HN: Are you using postcss?
I'm going to keep using sass, but has anybody made the jump and not looked back?
Also, am I right in thinking postcss is on the up? I really don't hear much about it or see it used in many open source projects.
I'm going to keep using sass, but has anybody made the jump and not looked back?
Also, am I right in thinking postcss is on the up? I really don't hear much about it or see it used in many open source projects.
* postcss-cssnext, preset of CSS drafts polyfills. It is not 100% preprocessor, but because of CSS custom properties and CSS nested polyfill it could do preprocessor work. * PreCSS, preset of PostCSS plugins with Sass-like features.
I use PreCSS. It is more simple preprocessor. It has no some Sass features by design, to keep your code clean of code.
Using PreCSS doesn’t give me some addition features, just same old $style variables, nesting, mixins.
The reason why I use PreCSS — performance and compatibility. If you use Autoprefixer or Stylelint, you already have PostCSS in your build processor. In this case, why you should use other parser? PreCSS will share parsing with Autoprefixer, Stylelint and other PostCSS tools.
PostCSS will parse CSS only once and all that plugins will work on top of same AST. As result build process will be simpler and faster.
This is why main reason to use PostCSS is to have non-preprocessors tools:
1. Autoprefixer.
2. Stylelint. Like ESLint, but for CSS. It will automatically find a mistakes in your CSS.
3. postcss-inline-svg, changes a SVG color when you insert it with base64.
4. CSS Modules, automatically isolate your CSS components (like auto-BEM, but with better isolation).
5. postcss-cssnext, if you are fan of CSS Custom Properties and want to use them right now (for some simple cases, of course there is no dynamic Custom Properties).
So using PostCSS != not using Sass. You could use Sass for processors, but still using PostCSS for other CSS tools types — for Autoprefixer, Stylelint, cssnano.