Standalone Tailwind CSS CLI, installable via pip

Overview

Standalone Tailwind CSS CLI, installable via pip

Use Tailwind CSS without Node.js and install it via pip.

Why

Tailwind CSS is notoriously dependent on Node.js. If you're a Python developer, this dependency may not be welcome in your team, your Docker container, or your inner circle.

The Tailwind CSS team recently announced a new standalone CLI build that gives you the full power of Tailwind CLI in a self-contained executable — no Node.js or npm required.

However, installing such a standalone CLI isn't as easy as running npm install, the installation command for Node.js .

That's why I decided to make it as simple as running pip install command. As a result you can install the standalone * Tailwind CLI* via pip by running the following command:

pip install pytailwindcss

Now you can run tailwindcss in your terminal as:

tailwindcss -i input.css -o output.css --minify

Voila!

Get started

  1. Install tailwindcss via pip by executing the following command:

    pip install pytailwindcss
    
  2. The tailwindcss command should now be available in your terminal. Try to run it:

    tailwindcss
    

    If the installation was successful, you should see the message about binary being downloaded on the first run. When download is complete, you should see the help output for the tailwindcss command. Use tailwindcss to create a new project or work with an existing Tailwind CSS project.

  3. Let's create a new project. Go to the directory where you want to host your Tailwind CSS project and initialize it by running:

    tailwindcss init
    

    This command will create the default tailwind.config.js file.

  4. Start a watcher by running:

    tailwindcss -i input.css -o output.css --watch
    
  5. Compile and minify your CSS for production by running:

    tailwindcss -i input.css -o output.css --minify
    

You got it. Please refer to official Tailwind documentation for more information on using Tailwind CSS and its CLI.

Caveats

It's not all roses, though. Giving up Node.js means you won't be able to install plugins or additional dependencies for your Tailwind CSS setup. At the same time, that might not be a dealbreaker. You can still customize Tailwind CSS via the tailwind.config.js file. And the standalone build also comes with all official Tailwind CSS plugins like @tailwindcss/aspect-ratio, @tailwindcss/forms, @tailwindcss/line-clamp, and @tailwindcss/typography. So in 90% of Tailwind CSS usage cases you should be covered, and the setup is so simplified now.

Here is what the Tailwind CSS team says about going the standalone Tailwind CSS route:

If you’re working on a project where you don’t otherwise need Node.js or npm, the standalone build can be a great choice. If Tailwind was the only reason you had a package.json file, this is probably going to feel like a nicer solution.

Bugs and suggestions

If you have found a bug, please use the issue tracker on GitHub.

https://github.com/timonweb/pytailwindcss/issues

2021 (c) Tim Kamanin - A Full Stack Django and Wagtail Developer

Owner
Tim Kamanin
Proactive full stack developer
Tim Kamanin
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 75k Jan 02, 2023
A collection of command-line interface games written in python

Command Line Interface Python Games Collection of some starter python game projects for beginners How to play these games Clone this repository git cl

Paras Gupta 7 Jun 06, 2022
asciinema - Terminal session recorder 📹

asciinema - Terminal session recorder 📹

asciinema 11.1k Dec 27, 2022
A command line tool to hide and reveal information inside images (works for both PNGs and JPGs)

ImgReRite A command line tool to hide and reveal information inside images (work

Jigyasu 10 Jul 27, 2022
Python CLI for accessing CSCI320 PDM Database

p320_14 Python CLI for accessing CSCI320 PDM Database Authors: Aidan Mellin Dan Skigen Jacob Auger Kyle Baptiste Before running the application for th

Aidan Mellin 1 Nov 23, 2021
Easily handle day to day CLI operation via Python instead of regular Bash programs.

pz Ever wished to use Python in Bash? Would you choose the Python syntax over sed, awk, ...? Should you exactly know what command would you use in Pyt

CZ.NIC 697 Jan 03, 2023
A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands

PIGIT A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands. For example: git status --short, this project c

Zachary 1 Apr 09, 2022
CLI Utility to encode and recursively recreate directories with ffmpeg.

FFenmass CLI Utility to encode and recursively recreate directories with ffmpeg. Report Bug · Request Feature Table of Contents Getting Started Prereq

George Av. 8 May 06, 2022
A clone of the popular online game Wordle

wordle_clone A CLI application for wordle. Description A clone of the popular online game Wordle.

0 Jan 29, 2022
A command line interface to interact with the Hypixel api allowing the user to get stats, leaderboards, etc

HyConsole is a way to get data on players and leaderboards from the Hypixel Minecraft server from the command line. Keep in mind I have no a

1 Feb 14, 2022
Double Pendulum visualised with fetching system information in Python.

Show off your terminal, in style. A nice relaxing double pendulum simulation using ASCII, able to simulate multiple pendulums at once, and provide tra

Nekurone 62 Dec 14, 2022
CLI based Crunchyroll Account Checker Proxyless written in python from scratch.

A tool for checking Combolist of Crunchyroll accounts without proxies, It is written in Python from Scratch ,i.e, no external module is used rather than inbuilt Python modules.

Abhijeet 8 Dec 13, 2022
A python CLI app that converts a mp4 file into a gif with ASCII effect added.

Video2ASCIIgif This CLI app takes in a mp4 format video, converts it to a gif with ASCII effect applied. This also includes full control over: backgro

Sriram R 6 Dec 31, 2021
A minimal todo list for your terminal.

todo A minimal todo list for your terminal. Installation Run the following command. pip install git+https://github.com/piero-vic/todo.git Usage todo

Piero Lescano 7 Aug 08, 2022
Python3 library for multimedia functions at the command terminal

TERMINEDIA This is a Python library allowing using a text-terminal as a low-resolution graphics output, along with keyboard realtime reading, and a co

Joao S. O. Bueno 89 Dec 17, 2022
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.

mycli A command line client for MySQL that can do auto-completion and syntax highlighting. HomePage: http://mycli.net Documentation: http://mycli.net/

dbcli 10.7k Jan 07, 2023
A simple command line tool for changing the icons of folders or files on MacOS.

Mac OS File Icon Changer Description A small and simple script to quickly change large amounts or a few files and folders icons to easily customize th

Eroxl 3 Jan 02, 2023
A Command Line Calculator With Python

CalculadoraPY Usando no Termux apt install python3 apt install git pip3 install termcolor git clone https://github.com/kayke981/CalculadoraPY.git

kayake 5 Jan 30, 2022
Palm CLI - the tool-belt for data teams

Palm CLI: The extensible CLI at your fingertips Palm is a universal CLI developed to improve the life and work of data professionals. Palm CLI documen

Palmetto 41 Dec 12, 2022
A cli tool , which shows you all the next possible words you can guess from in the game of Wordle.

wordle-helper A cli tool , which shows you all the next possible words you can guess from the Game Wordle. This repo has the code discussed in the You

1 Jan 17, 2022