Skip to main content

How does a postprocessor differ from a preprocessor (SASS/LESS)?

A postprocessor and a preprocessor solve different tasks and work at different stages of CSS processing.


1. When it works

ToolWhen it is applied
Preprocessor (SASS/LESS)before CSS exists: the code does not exist yet, it is only being generated
Postprocessorafter CSS exists: processing is applied to existing CSS

2. Main goal

ToolWhat it is for
Preprocessoradding new capabilities (variables, nesting, mixins, functions) and simplifying writing styles
Postprocessorimproving finished CSS for production (cross-browser support, minification, optimization)

3. Type of changes

ToolWhat it does
Preprocessorgenerates CSS based on extended syntax
Postprocessormodifies CSS that already exists, but does not extend the language

4. Typical tasks

Preprocessor:

  • variables, nesting, mixins, functions
  • a modular style structure
  • reduced duplication
  • development convenience

Postprocessor:

  • adding vendor prefixes (for example, -webkit-)
  • minification
  • optimizing the final file
  • supporting new CSS features before browsers adopt them (via plugins)

5. Examples

TypeTools
PreprocessorSass, LESS, Stylus
PostprocessorPostCSS with plugins (Autoprefixer, cssnano)

Summary

A preprocessor is about comfort and convenience when writing code. A postprocessor is about the quality of the finished CSS in production.

They are often used together: SASS first generates the CSS, then PostCSS improves it before publishing.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.