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

postcss-lazysprite

31
Stars
7
Forks
Watchers

A PostCSS plugin that automatic generates sprites from the directory of images with hight perfomance.

astorinomattia.com

26
Stars
4
Forks
Watchers

Personal website built with XITY, Eleventy, PostCSS, Parcel and Contentful

xity-starter

203
Stars
17
Forks
Watchers

A blog-ready 11ty starter based on PostCSS, with RSS feed and Native Elements!

find-unused-sass-variables

60
Stars
14
Forks
Watchers

A simple tool to find unused Sass variables

elm-batteries

116
Stars
4
Forks
Watchers

Learn how Elm, Parcel, Cypress and Netlify work together. Get started with Elm navigation, routes, remote data and decoder.

astexplorer

6.0k
Stars
707
Forks
Watchers

A web tool to explore the ASTs generated by various parsers.

react-native-postcss-transformer

25
Stars
0
Forks
Watchers

A babel transformer that adds PostCSS support for React Native apps

awesome-postcss

425
Stars
19
Forks
Watchers

A curate list about PostCSS

postcss-utilities

319
Stars
11
Forks
Watchers

PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS

css-in-react

104
Stars
13
Forks
Watchers

🍭 CSS in React - Learn the best CSS in JS frameworks by example