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

laravel-boilerplate

43
Stars
9
Forks
Watchers

A Laravel boilerplate with Inertia.js, Vue.js, TypeScript, Tailwind CSS, and client-side theming

kita

17
Stars
0
Forks
Watchers

🎒 Static site/prototyping with Pug, PostCSS, and ES6.

soba

16
Stars
1
Forks
Watchers

Kirby starter theme that uses Twig, PostCSS, and Browsersync

postcss-remtopx

6
Stars
0
Forks
Watchers

PostCSS plugin for converting rem to px

ecss

10
Stars
0
Forks
Watchers

Home for questions and answers relating to the implementation of the ECSS methodology

postcss-at-rules-variables

58
Stars
4
Forks
Watchers

PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else and more...

csscompile

6
Stars
1
Forks
Watchers

Compile, optimize and compress anything to CSS.

cessie

80
Stars
2
Forks
Watchers

Transpile your CSS bundle to support CSS variables, calc, and future CSS for legacy browsers.

postcss-prefix-selector

153
Stars
15
Forks
Watchers

Prefix all CSS rules with a selector

postcss-lazyimagecss

39
Stars
1
Forks
Watchers

A PostCSS plugin that generates images's CSS width & height properties automatically.