PostCSS - my initial experience
Published: 2024-01-11 15:06:22

## Intro
I was about to make the title something like this- 

> **PostCSS - a real-life time machine for CSS lovers**
 
Then I thought, it's too dramatic. Let's keep it simple. (and now you know I loved this title more 😀)

I've been a CSS lover from the beginning of my career, but not like [Ben Evans the CSS Artist](https://codepen.io/ivorjetski), I mean he took CSS to another level. 

Anyway, when I first learned about PostCSS and what it's capable of, it was very overwhelming for me and I was shocked. Then I started to learn its limitations, pros & cons, which plugins are used most, and where to get the plugins and things like that.

So, today I'm going to share some information that I was looking for but didn't find when I was learning. If this information had been published somewhere, my journey could have been easier and much shorter.

## information
I mean, if I knew that 
- the plugins in the [official PostCSS website](https://postcss.org/) were old like IE6 or the `marquee` tag, and
- the [updated plugins](https://github.com/csstools/postcss-plugins/tree/main/plugins) were in [postcss-plugins repo](https://github.com/csstools/postcss-plugins/tree/main) by [csstools](https://github.com/csstools), and
- the author of the most popular PostCSS plugin himself [recommended](https://moox.io/blog/deprecating-cssnext) the [postcss-preset-env](https://preset-env.cssdb.org/) over his own creation which is [cssnex](https://cssnext.github.io/), and
- there was 
  - a [playground](https://preset-env.cssdb.org/playground/), 
  - [a list of features](https://preset-env.cssdb.org/features/) that you can filter by stage, 
  - and [much more for postcss-preset-env](https://preset-env.cssdb.org/), 

then it would have been easier to search & research and to make the native CSS much more powerful than SCSS. But anyway, we are here now, and if my experience can make any contribution to other's journey, that would be very rewarding 😎. 

This is a table to compare how we can reduce the number of plugins with more features & efficiency.

<table>
<thead>
<tr>
<td> <strong>OLDER PLUGINS WITH COOL FEATURES</strong> </td>
<td> <strong>MUCH BETTER & UPDATED ALTERNATIVE</strong> </td>
</tr>
</thead>
<tbody>
<tr>
<td> <a href="https://cssnext.github.io/">cssnext</a> || <a href="https://moox.io/blog/deprecating-cssnext">about <em>cssnext</em> to <em>Preset Env</em></a></td>
<td rowspan="4"> <a href="https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env">Preset Env</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/csstools/postcss-custom-media">Postcss Custom Media</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/postcss/postcss-media-minmax">Postcss Media Minmax</a> </td>
</tr>
<td>Nesting <a href="https://preset-env.cssdb.org/features/">and much much more...</a></td>
<tr>
<td> <a href="https://github.com/postcss/postcss-simple-vars">Postcss Simple-Vars</a> </td>
<td rowspan="6"> <a href="https://github.com/csstools/postcss-advanced-variables">Postcss Advanced Variables</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/andyjansson/postcss-conditionals">Postcss Conditionals</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/madyankin/postcss-each">Postcss Each</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/antyakushev/postcss-for">Postcss For</a> </td>
</tr>
<tr>
<td> <a href="https://github.com/postcss/postcss-mixins">PostCSS Mixins</a></td>
</tr>
<tr>
<td>
and more, like <a href="https://github.com/andyjansson/postcss-conditionals">conditionals</a> (<code>@if / @else</code>), <a href="https://github.com/madyankin/postcss-each">@each</a>, <a href="https://github.com/antyakushev/postcss-for">@for</a> etc.
</td>
</tr>
</tbody>
</table>


## Conclusion
I encountered the PostCSS while diving into Tailwind CSS and trying to integrate SCSS with it. My goal was to achieve SCSS functionalities and other cool features within native CSS, eliminating the need for SCSS in Tailwind. And that's how my PostCSS journey began.

However, it's important to note that not everyone using PostCSS shares the same purpose. The tool offers loads of possibilities beyond my initial use case.

As I continue to learn, I welcome contributions from others who can share valuable PostCSS resources in the comments. Your input would be greatly appreciated!