PostCSS topic

PostCSS is a tool for transforming CSS with JavaScript. It can be used to develop a template language such as Sass and LESS. The PostCSS core consists of:

  • CSS parser that generates an abstract syntax tree
  • Set of classes that comprises the tree
  • CSS generator that generates a CSS line for the object tree
  • Code map generator for the CSS changes made#

There are official tools making it possible to use PostCSS with build systems such as Webpack, Gulp, and Grunt. There is also a console interface available. Browserify or Webpack can be used to open PostCSS in a browser.

The complete plugin list can be found on postcss.parts, with some examples listed below.

  • Autoprefixer to add and clear browser prefixes.
  • CSS Modules to get CSS selectors isolated and code organized. It is supplied as part of Webpack.
  • stylelint to analyze CSS code for mistakes and check style consistency.
  • stylefmt fixes the CSS code according to the stylelint settings.
  • PreCSS to perform some Sass/Less preprocessing functions.
  • postcss-preset-env to emulate features from unfinished CSS specification drafts.
  • cssnano to make CSS smaller in size by getting rid of the spaces and rewriting the code.
  • RTLCSS to change CSS code so that the design should be suitable for right-to-left writing (such is applied in Arabic and Hebrew).
  • postcss-assets, postcss-inline-svg and postcss-sprites to work with graphics.

List PostCSS repositories

kratos-boilerplate

313
Stars
37
Forks
Watchers

:fire: A simple boilerplate for creating statics PWA using Webpack, Pug, PostCSS and CSS Modules

css-declaration-sorter

316
Stars
16
Forks
Watchers

Sort CSS declarations fast and automatically in a certain order.

lost

4.5k
Stars
161
Forks
Watchers

LostGrid is a powerful grid system built in PostCSS that works with any preprocessor and even vanilla CSS.

typescript-plugin-css-modules

1.3k
Stars
71
Forks
Watchers

A TypeScript language service plugin providing support for CSS Modules.

astexplorer.app

119
Stars
11
Forks
Watchers

An https://astexplorer.net wrapper which adds module bundling and hot reloading.

atom-language-postcss

55
Stars
13
Forks
Watchers

:atom: Atom language support for PostCSS

postcss-instagram

119
Stars
3
Forks
Watchers

:camera: PostCSS plugin for using Instagram filters in CSS

atom-postcss-sorting

47
Stars
3
Forks
Watchers

Atom editor plugin to sort CSS rules content with specified order.

hugo-product-launch

59
Stars
25
Forks
Watchers

🚀 A Hugo theme for young start-ups, product launches, and »coming soon«-websites. Includes contact form & newsletter sign up via Netlify. Deploy with one click!