Skip to content

Instantly share code, notes, and snippets.

@mohamadaliakbari
Last active December 13, 2021 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohamadaliakbari/4b24561873506ef39a8101780a55f7dd to your computer and use it in GitHub Desktop.
Save mohamadaliakbari/4b24561873506ef39a8101780a55f7dd to your computer and use it in GitHub Desktop.
How to install Tailwind CSS standalone with plugins

Setup

enviroment with tailwindcss + plugins

Source: https://tailwindcss.com/docs/installation#using-tailwind-cli

Install and init

  • Install core utilities: npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
  • Init project: npx tailwindcss init this will create tailwind.config.js

Create stylesheets

  • src/tailwind.css with following content:
/* ./src/tailwind.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

Install plugin

npm install tailwindcss-rtl --save-dev and edit tailwind.config.js:

plugins: [
  require('tailwindcss-rtl'),
],

Build

npx tailwindcss -i ./src/tailwind.css -o ./dist/tailwind.css --watch

Enable browser sync

Using https://browsersync.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment