Add Tailwind CSS to PUG

Search for a command to run...

No comments yet. Be the first to comment.
Introduction Argo Workflows is an open-source workflow orchestration tool for Kubernetes. In this tutorial, we will walk through the steps to install Argo Workflows on a Kubernetes cluster and access its server UI. Step 1: Check Current Context Befor...

The Azure CLI is a powerful tool for managing and automating tasks in Azure. To use the Azure CLI, you need to log in to your Azure account. In this blog, we will go over the different methods you can use to log in to Azure using the Azure CLI. Log i...

Connecting to an Azure VM from windows can be a bit tricky and you may get errors like WARNING: UNPROTECTED PRIVATE KEY FILE! Permissions for ' ' are too open, It is required that your private key files are NOT accessible by others This private key w...

A methodology where all the configurational and/or infrastructure codes are set up in a separate single repository is known as GitOps. This suits tools like Ansible, Terraform and Kubernetes, where they do require separate files for their configurati...

Straight to the point, there are tons of things to ask in JS, but these are a few of them which can be a quick refresher. Event loop, Single-threaded programming language - Explain, Asynchronous and synchronous, Promises and callbacks, "This" ke...

Without further ado, let's get started on adding it.
I have a node.js application with a templating engine - Here currently I am using PUG.
The first step is to install tailwind CSS,
npm i tailwindcss
The second step is to create a tailwind.config.js file, which can be created using
npx tailwindcss init
The third step is to create two files, Input.css and output.css - You can decide with your own naming convention.
Add the following in the input.css file,
@tailwind base;
@tailwind components;
@tailwind utilities;
Add output.css as your stylesheet in your pug files or the HTML files,

As a final step,
npx tailwindcss -i path/to/input.css -o path/to/output.css --watch
I have it inside the public folder which is in the project root location, so I would write it as,
npx tailwindcss -i ./public/input.css -o ./public/main.css --watch
Now start adding classes to the template, or start adding tailwind classes to the template classes.
You can add this to your input.css file if in case,

This should work, let me know if you find this helpful.
Have a great day, and see you at the next one.