Description
Given the existence of node-wheel-binaries on PyPI and the broken PyCharm plugin for Tailwind CSS, which relies on a locally installed Tailwind CSS, it might be an idea to another mode for the library.
The library currently supports three modes:
- By default it uses the official CLI builds.
- A locally installed binary can be used by setting
TAILWIND_CLI_PATH
to the complete path. - Install an externally built binary by specifying
TAILWIND_CLI_SRC_REPO
andTAILWIND_CLI_ASSET_NAME
.
With the introduction of Tailwind CSS 4.x support, the library relies on checking the major version of Tailwind CSS. This is necessary because of the change behaviour concerning configuration but also because the --config
parameter isn't available in Tailwind CSS CLI 4.x.
This breaks as mentioned in #150 (comment) the behavior for externally build versions of Tailwind CSS, that don't follow the official versioning scheme. This applies for example to https://github.com/dobicinaitis/tailwind-cli-extra if you try to install it using the settings TAILWIND_CLI_SRC_REPO
and TAILWIND_CLI_ASSET_NAME
.
Based on the things stated above, I am considering changing the behavior of the library and supporting the following modes:
- By default, it uses the official CLI builds and can support Tailwind CSS 3.x and 4.x.
- A globally installed binary can be used by setting
TAILWIND_CLI_PATH
to the absolute path. - Install an externally built binary by specifying
TAILWIND_CLI_SRC_REPO
andTAILWIND_CLI_ASSET_NAME
. - A project local installed binary is used. This installation is based on
node-wheel-binaries
and fully encapsulated by the library. It would only introduce a package.json file to the project.
For mode 2, 3 and 4, a new variable TAILWIND_CLI_LEGACY
is introduced. If it is set to True, the library assumes the interface of Tailwind CSS CLI 3.x and otherwise the interface of Tailwind CSS CLI 4.x. The default would be False.
The advantage of mode 4 is, that it adds support for PyCharm without any awful hacks, without the necessity to handle a node installation yourself. And it might also be the easiest way to add support for DaisyUI and friends.
Discuss! Feedback welcome.