Add PostCSS support

I noticed someone mentioned in this issue that we should add PostCSS support, and @keats have replied:

I’m not super interested in that approach, the main draw to Zola for me is that it is a single binary. Having to install node + npm install some libraries is not a great workflow imo. If you wanted to do that, you don’t need to go through zola imo you can just write a small make file for it.

Firstly, I totally understand. However, I think PostCSS is more powerful than Sass and deserve as a Zola CSS building option. For me, I can use Tailwindcss ( a PostCSS plugin ) to build my Zola website.

Whatmore, build PostCSS is easy, just call postcss command to compile the target css file, for example, postcss index.css -d static/css -w.
So, maybe we can add the PostCSS option in config.toml to support this?

What do you think? I’d love to submit PR if is ok :slight_smile:

I would disagree :stuck_out_tongue:

postcss is not written in Rust and it cannot be shipped with the Zola binary, it needs to be installed separately. The integration would be no different than a Makefile so that’s not an interesting value-add for Zola. Especially since you will most definitely need postcss plugins installed via npm in the first place to do anything interesting with it.

I think plugins would be a better route if plugins can be added to Zola. This way no need to bundle this with Zola but it can be added through a plugin. A plugin can be a scripting language like Dyon and Gluon for scripting and Nushell for commands which are all rust base and can be embedded. By saving the scripts in the plugin directory one can add plugins and in plugins. For commands, one can have commands which are executed based on config on what to call for each life cycle event.

Just an idea.