From 8a2fb3770e27f6e9c026ebff1694237ca770bf58 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 10 Dec 2022 22:16:12 +0000 Subject: [PATCH] docs(daily-email): add 2022-12-09 --- website/src/daily-emails/2022-12-09.md | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 website/src/daily-emails/2022-12-09.md diff --git a/website/src/daily-emails/2022-12-09.md b/website/src/daily-emails/2022-12-09.md new file mode 100644 index 00000000..05127984 --- /dev/null +++ b/website/src/daily-emails/2022-12-09.md @@ -0,0 +1,28 @@ +--- +title: > + How and why I started using PostCSS +pubDate: 2022-12-09 +permalink: > + archive/2022/12/09/how-and-why-i-started-using-postcss +tags: + - css + - front-end +--- + +I assume that, like many other Developers, when I started learning front-end development, I wrote normal, plain CSS and later discovered and adopted pre-processors like Less and Sass that added features such as variables and nesting to my stylesheets. + +This was the case when I first saw what became Tailwind CSS, which were some stylesheets written in Less and ported manually between projects. + +I remember watching one of those streams, and a fellow viewer suggested PostCSS, which Tailwind CSS would later be written in. + +PostCSS, a CSS post-processor rather than a pre-processor, has become my preferred way of writing CSS because of Tailwind. + +When I started using Tailwind in my projects, I was layering it on top of another CSS framework or styles that were written using Less or Sass, so I needed to pre-process them into CSS first and then run PostCSS - essentially running two build steps and adding to the build time. + +I moved to use PostCSS by default - removing one of the build steps. + +What I liked about it, as well as the quicker build times, was that I could start with plain CSS and add the extra features I needed. I didn't use all of Sass and Less' features, and now, if I needed nesting or real-time imports, I could add it via a PostCSS plugin or write my own. + +It's also quick and easy to use, using the PostCSS CLI tool and without more complex tools like Webpack. + +If you haven't tried PostCSS, I recommend taking a look.