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: README.md
+27-43Lines changed: 27 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,26 +24,17 @@ def deps do
24
24
end
25
25
```
26
26
27
-
However, if your assets are precompiled during development,
28
-
then it only needs to be a dev dependency:
29
-
30
-
```elixir
31
-
defdepsdo
32
-
[
33
-
{:tailwind, "~> 0.3", only::dev}
34
-
]
35
-
end
36
-
```
37
-
38
27
Once installed, change your `config/config.exs` to pick your
39
28
Tailwind version of choice:
40
29
41
30
```elixir
42
-
config :tailwind, version:"4.0.9"
31
+
config :tailwind, version:"4.1.12"
43
32
```
44
33
45
-
Note that `:tailwind` 0.3+ assumes Tailwind v4+ by default. It still supports Tailwind v3, but some configuration options when setting up a new
46
-
project might be different. If you use Tailwind v3, also have a look at [the README in the 0.2 branch](https://github.com/phoenixframework/tailwind/blob/v0.2/README.md).
34
+
Note that `:tailwind` 0.3+ assumes Tailwind v4+ by default.
35
+
It still supports Tailwind v3, but some configuration options
36
+
when setting up a new project might be different. If you use
37
+
Tailwind v3, also have a look at [the README in the 0.2 branch](https://github.com/phoenixframework/tailwind/blob/v0.2/README.md).
47
38
48
39
Now you can install Tailwind by running:
49
40
@@ -73,11 +64,11 @@ Where `TARGET` is your system target architecture.
73
64
The first argument to `tailwind` is the execution profile.
74
65
You can define multiple execution profiles with the current
75
66
directory, the OS environment, and default arguments to the
76
-
`tailwind` task:
67
+
`tailwind` task in your `config/config.exs`:
77
68
78
69
```elixir
79
70
config :tailwind,
80
-
version:"4.0.9",
71
+
version:"4.1.12",
81
72
default: [
82
73
args:~w(
83
74
--input=assets/css/app.css
@@ -88,22 +79,7 @@ config :tailwind,
88
79
```
89
80
90
81
When `mix tailwind default` is invoked, the task arguments will be appended
91
-
to the ones configured above. Note profiles must be configured in your
92
-
`config/config.exs`, as `tailwind` runs without starting your application
93
-
(and therefore it won't pick settings in `config/runtime.exs`).
94
-
95
-
We also strongly recommend setting up the `@source` paths in your in `app.css`
96
-
file, for example:
97
-
98
-
```css
99
-
@source "../css";
100
-
@source "../js";
101
-
@source "../../lib/YOUR_APP_web";
102
-
```
103
-
104
-
This will make Tailwind watch `assets/css`, `assets/js` and `lib/YOUR_APP_web`.
105
-
Without those, too many files (including build artifacts) may be watched,
106
-
leading to frequent recompilations.
82
+
to the ones configured above.
107
83
108
84
## Adding to Phoenix
109
85
@@ -117,7 +93,7 @@ as a dependency in your `mix.exs`:
117
93
```elixir
118
94
defdepsdo
119
95
[
120
-
{:phoenix, "~> 1.7"},
96
+
{:phoenix, "~> 1.8"},
121
97
{:tailwind, "~> 0.3", runtime:Mix.env() ==:dev}
122
98
]
123
99
end
@@ -136,7 +112,7 @@ We'll also give it our `assets/css/app.css` as our css entry point:
136
112
137
113
```elixir
138
114
config :tailwind,
139
-
version:"4.0.9",
115
+
version:"4.1.12",
140
116
default: [
141
117
args:~w(
142
118
--input=assets/css/app.css
@@ -147,14 +123,14 @@ config :tailwind,
147
123
```
148
124
149
125
> Make sure the "assets" directory from priv/static is listed in the
150
-
> :only option for Plug.Static in your lib/my_app_web/endpoint.ex
126
+
> `:only` option for Plug.Static in your `lib/my_app_web/endpoint.ex`
151
127
152
128
If your Phoenix application is using an umbrella structure, you should specify
153
129
the web application's asset directory in the configuration:
0 commit comments