You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,30 @@
2
2
3
3
## 4.2.0
4
4
5
-
> [!WARNING]
5
+
> [!CAUTION]
6
6
> Version 4.2.x and onward only support Tailwind CSS 4.x. If you are using Tailwind CSS 3.x,
7
7
> please use version 2.21.1 of this library. Version 4.0.x or 4.1.x still support Tailwind CSS 3.x, but
8
8
> these versions are not recommended to use for new projects.
9
9
10
+
> [!CAUTION]
11
+
> This version includes changes to the handling of `TAILWIND_CLI_PATH` and `TAILWIND_CLI_SRC_CSS`.
12
+
10
13
- Default fallback version is now 4.1.3.
11
14
- Removed support for Tailwind CSS 3.x. The main reason is that this makes the library easier to maintain and also add better support for custom CLI builds which support DaisyUI and other plugins.
12
15
- django-tailwind-cli now uses proper platform directories to store the CLI binary.
13
-
- The proper directories are powered by [platformdirs](https://pypi.org/project/platformdirs/).
14
-
- TAILWIND_CLI_PATH is now optional by default.
15
-
- If TAILWIND_CLI_PATH is None, the binary is stored in `user_data_dir("django-tailwind-cli", "django-commons")`.
16
-
- The library doesn't rely anylonger on a properly set `settings.BASE_DIR`.
17
-
- TAILWIND_CLI_ASSET_NAME is also used for the downloaded CLI to distinguish between `tailwindcss` and `tailwindcss-extra`.
16
+
17
+
* The proper directories are powered by [platformdirs](https://pypi.org/project/platformdirs/).
18
+
*`TAILWIND_CLI_PATH` is now optional by default.
19
+
* If `TAILWIND_CLI_PATH` is None, the binary is stored in `user_data_dir("django-tailwind-cli", "django-commons")`.
20
+
* The library doesn't rely anylonger on a properly set `settings.BASE_DIR`.
21
+
22
+
-`TAILWIND_CLI_ASSET_NAME` is also used for the downloaded CLI to distinguish between `tailwindcss` and `tailwindcss-extra`.
23
+
- The behaviour of `TAILWIND_CLI_SRC_CSS` has been changed. The reasoning behind this change was, less default code inside the project and whitenoise had issues with a CSS file inside an asset folder referencing non-existing imports.
24
+
25
+
* It defaults to `None`.
26
+
* If it is `None` the default input file is created in the user cache directory.
27
+
* If it is a relative path, this path is considered relative to `settings.BASE_DIR`.
Copy file name to clipboardExpand all lines: docs/settings.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,14 @@ your project.
29
29
30
30
This allows you to override the default of the library where to store the CLI binary.
31
31
32
-
The default behaviour is to store the CLI binary in directory return by this call `platformdirs.user_data_dir("django-tailwind-cli", "django-commons")`. Checkout [platformdirs](https://pypi.org/project/platformdirs/) for details.
32
+
The default behaviour is to store the CLI binary in the directory returned by this call `platformdirs.user_data_dir("django-tailwind-cli", "django-commons")`. Checkout [platformdirs](https://pypi.org/project/platformdirs/) for details.
33
33
34
34
But if you want to store it elsewhere or plan to use a custom build binary stored locally, change this setting either to a path to a directory or the full path to the binary. If it points to a directory, this is the download destination otherwise it directly tries to use the referenced binary.
35
35
36
-
!!! warning
37
-
38
-
If you use the new option from **2.7.0** but haven't installed a binary before running any of the management commands, these commands will treat the configured path as a directory and create it, if it is missing. Afterwards the official CLI will be downloaded to this path.
39
-
40
-
In case you want to use the new behaviour, it is highly recommended to also set the new setting `TAILWIND_CLI_AUTOMATIC_DOWNLOAD` to `False`.
36
+
> [!Warning]
37
+
> If you use the new option from **2.7.0** but haven't installed a binary before running any of the management commands, these commands will treat the configured path as a directory and create it, if it is missing. Afterwards the official CLI will be downloaded to this path.
38
+
>
39
+
> In case you want to use the new behaviour, it is highly recommended to also set the new setting `TAILWIND_CLI_AUTOMATIC_DOWNLOAD` to `False`.
41
40
42
41
`TAILWIND_CLI_AUTOMATIC_DOWNLOAD`
43
42
: **Default**: `True`
@@ -49,9 +48,8 @@ your project.
49
48
50
49
Specifies the repository from which the CLI is downloaded. This is useful if you are using a customized version of the CLI, such as [tailwind-cli-extra](https://github.com/dobicinaitis/tailwind-cli-extra).
51
50
52
-
!!! warning
53
-
54
-
If you use this option, ensure that you update the `TAILWIND_CLI_VERSION` to match the version of the customized CLI you are using. Additionally, you may need to update the `TAILWIND_CLI_ASSET_NAME` if the asset name is different. See the example below.
51
+
> [!Warning]
52
+
> If you use this option, ensure that you update the `TAILWIND_CLI_VERSION` to match the version of the customized CLI you are using. Additionally, you may need to update the `TAILWIND_CLI_ASSET_NAME` if the asset name is different. See the example below.
55
53
56
54
`TAILWIND_CLI_ASSET_NAME`:
57
55
: **Default**: `"tailwindcss"`
@@ -60,22 +58,24 @@ your project.
60
58
61
59
This option is particularly useful if the customized repository you are using has a different name for the Tailwind CLI asset. For example, the asset name for [tailwind-cli-extra](https://github.com/dobicinaitis/tailwind-cli-extra/releases/latest/) is `tailwindcss-extra`.
62
60
63
-
!!! Note
64
-
65
-
Here is a full example of using a custom repository and asset name:
61
+
> [!Note]
62
+
> Here is a full example of using a custom repository and asset name:
This variable can be set to `None`, a relative path and an absolute path.
73
+
74
+
If it is set to `None`, the library creates file with the name `source.css` in the directory returned by this call `platformdirs.user_cache_dir("django-tailwind-cli", "django-commons")`. Checkout [platformdirs](https://pypi.org/project/platformdirs/) for details.
75
+
76
+
If it is a relative path it is assumed to be relative to `settings.BASE_DIR`. If `settings.BASE_DIR` is not defined or the file doesn't exist a `ValueError` is raised.
75
77
76
-
For **Tailwind CSS 4.x** this required file is used to configure Tailwind CSS and also add
77
-
additional CSS rules for your project. This file is stored relative to the first element of
78
-
the `STATICFILES_DIRS` array.
78
+
If it is an absolute path, this path is used as the input file for Tailwind CSS CLI. If the path doesn't exist, a `ValueError`is raised.
0 commit comments