V
V
vasIvas2015-10-19 17:25:48
css
vasIvas, 2015-10-19 17:25:48

What is postcss?

Google articles do not make it completely clear what PostCSS is. Everywhere they say that this is a miracle, but when asked what this library does, I answer - it does well.
If you do not give links to articles that you yourself have not read or read and did not understand, then what is PostCSS?
Why was it made when there is sass?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Denis Ineshin, 2015-10-19
@vasIvas

UPD: There was a bug. I meant CSSNext.

S
sergey, 2015-10-19
@zorro76

In order, for example, that you can write such a task in gulp, and that's cool

gulp.task('postcss', function () {
  var processors = [
    colorShort,
    focus,
    precss,
    short,
    size,
    responsiveImages,
    clearFix,
    px2Rem,
    cssNext,
    cssMqpacker,
    byeBye,
    discardComments,
    cssNano
  ];
  return gulp.src('src/css/*.css')
    .pipe(postcss(processors))
    .pipe(gulp.dest('dist/css/'))
    .pipe(browserSync.stream());
});

A
Alex Elgin, 2018-04-29
@sijio

  1. The SASS architecture is monolithic, i.e. you can only use the features provided by its manufacturer. The PostCSS architecture is modular, easily extensible with new features by connecting plugins that, in principle, can be written by anyone. If you need some very special CSS handling that isn't in the set of published plugins, you can easily write your own plugin for that. Those. PostCSS will evolve faster with third party extensions to the plugin library.
  2. Due to the large number of plugins available , PostCSS already provides more options for processing CSS than SASS.
  3. At the input of SASS, they receive a CSS file template, which they form. This is where his work ends. PostCSS receives a CSS file as input, parses it into a style structure, which gives much more processing options. In addition, due to the precss plugin, PostCSS can do the same thing as SASS.
  4. And PostCSS is faster than SASS.

N
nort1986, 2016-01-25
@nort1986

In short, it was invented for backwards compatibility with CSS. If in sass you need to use mixins to write prefixes (@include border-radius(10px)). Then using Postcss you do not need to write this. The Postcss authors think it's cool. You yourself connect what you need))))
In practice, I can say that I need mixins, variables and @extend. I can't work without it, as a result, I don't see a special need for Postcss. But Postcss is developing quite rapidly, you need to look after it, maybe something from this will turn out to be normal. If you use sass and use it, don't bother.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question