Use Tailwind CSS with daisyUI without Node.js and install it via pip.
Project description
pytailwindcss-extra
Use Tailwind CSS with daisyUI without Node.js and install it via pip.
An extension of pytailwindcss with tailwind-cli-extra to enable daisyUI support.
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.
So the user timonweb created the pytailwindcss
package, which allows you to install the standalone Tailwind CLI with a simple pip
command.
While this package works well, there is one particular problem. Due to the binary nature of the Tailwind CLI, only the official Tailwind CSS plugins are included and other plugins, especially the very popular daisyUI plugin, cannot be installed (see #caveats).
Although the problem cannot be solved completely, daisyUI is very useful, not only for me, so the user dobicinaitis offers tailwind-cli-extra, a Tailwind CLI binary patched with daisyUI. Using this binary, pytailwindcss-extra extends pytailwindcss and provides the Tailwind CLI with the daisyUI plugin for the Python ecosystem.
Get started
-
Install
tailwindcss-extra
viapip
by executing the following command:pip install pytailwindcss-extra
-
The
tailwindcss-extra
command should now be available in your terminal. Try to run it:tailwindcss-extra
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-extra
command. Use it to create a new project or work with an existing Tailwind CSS project. -
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-extra init
This command will create the default tailwind.config.js file.
-
Start a watcher by running:
tailwindcss-extra -i input.css -o output.css --watch
-
Compile and minify your CSS for production by running:
tailwindcss-extra -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
, @tailwindcss/typography
and of
course daisyUI
. 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytailwindcss_extra-0.1.1.tar.gz
.
File metadata
- Download URL: pytailwindcss_extra-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1b7406c9d8422d818a5439be09918ea9639cc4b38339f2362d861cb46d0074 |
|
MD5 | c5c4af237b7aa9ca5703caf2fb25703a |
|
BLAKE2b-256 | 8747f294d05237e4bf2a5c0859132ecf1424efdb3d18bc2c4fcf112edfcbdc93 |
File details
Details for the file pytailwindcss_extra-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pytailwindcss_extra-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19d6fd5e94034172f0e8e5802db4c617185e7b58d43a8eb56f5d8c9556e6c683 |
|
MD5 | e1b6da3ea8a8cbd0ae19ecf0f8bca471 |
|
BLAKE2b-256 | 0a3da78c6f3d87efe87ce5d8ea3920e2372f65efa6a4453f9ddbf46d0c44e8d2 |