Initialize & Configure
Explore how to initialize and configure Tailwind CSS in a Svelte-based web application. Learn to install necessary packages, set up purge for efficient CSS bundling, and configure preprocessors to streamline styling integration.
We'll cover the following...
We'll cover the following...
Initializing and configuring
Create a new branch:
git switch -c add-tailwind-css
First things first, let’s install the necessary NPM packages and configure a few things to make Tailwind work with Svelte/Sapper.
Run the following command in the services/web directory:
npm i -D tailwindcss svelte-preprocess postcss autoprefixer
npm install
We have executed npm install to sync packages in package.json and package-lock.json.
Next, let’s use Tailwind’s initialization script:
...