tailwindcss-rails 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -7
- data/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb +1 -1
- data/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb +1 -1
- data/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt +2 -2
- data/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +6 -6
- data/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt +1 -1
- data/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt +4 -4
- data/lib/tailwindcss/commands.rb +1 -0
- data/lib/tailwindcss/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aa2cf1b89bf6e2c36561fc1837d68c909ec546c59389269f8ebb2b02636dd58
|
4
|
+
data.tar.gz: 9e31269f4da5d5b6af95c83ed8548f61a634d8f8e54aa821472196d4b10fe5ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 294d50739faaece4341840862dfb30d10b6f554f274430ac2f826556c8254e88a22872a4ca8bbcfb7dde7ccdc41b82980f4e3ff8431873ffa47994f36643e6a4
|
7
|
+
data.tar.gz: a8eed8a46d161699a7d3b70c5d9682df9605c0ea9cbc0ff98e82756847528f3e4c294c335c7b382c7c155ca9e3eaab7a1638eee3b6a59c424f463fe828fd16b8
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
- [Upgrading your application from Tailwind v3 to v4](#upgrading-your-application-from-tailwind-v3-to-v4)
|
13
13
|
* [You don't _have_ to upgrade](#you-dont-_have_-to-upgrade)
|
14
14
|
* [Upgrade steps](#upgrade-steps)
|
15
|
-
* [Troubleshooting](#troubleshooting)
|
15
|
+
* [Troubleshooting a v4 upgrade](#troubleshooting-a-v4-upgrade)
|
16
16
|
* [Updating CSS class names for v4](#updating-css-class-names-for-v4)
|
17
17
|
- [Developing with Tailwindcss](#developing-with-tailwindcss)
|
18
18
|
* [Configuration and commands](#configuration-and-commands)
|
@@ -20,9 +20,10 @@
|
|
20
20
|
* [Building for testing](#building-for-testing)
|
21
21
|
* [Building unminified assets](#building-unminified-assets)
|
22
22
|
* [Live rebuild](#live-rebuild)
|
23
|
+
* [Using Tailwind plugins](#using-tailwind-plugins)
|
23
24
|
* [Using with PostCSS](#using-with-postcss)
|
24
25
|
* [Custom inputs or outputs](#custom-inputs-or-outputs)
|
25
|
-
- [Troubleshooting](#troubleshooting
|
26
|
+
- [Troubleshooting](#troubleshooting)
|
26
27
|
* [Lost keystrokes or hanging when using terminal-based debugging tools (e.g. IRB, Pry, `ruby/debug`...etc.) with the Puma plugin](#lost-keystrokes-or-hanging-when-using-terminal-based-debugging-tools-eg-irb-pry-rubydebugetc-with-the-puma-plugin)
|
27
28
|
* [Running in a docker container exits prematurely](#running-in-a-docker-container-exits-prematurely)
|
28
29
|
* [Conflict with sassc-rails](#conflict-with-sassc-rails)
|
@@ -171,7 +172,7 @@ Done in 56ms
|
|
171
172
|
If this doesn't succeed, it's likely that you've customized your Tailwind configuration and you'll need to do some work to make sure your application upgrades. Please read the [official upgrade guide](https://tailwindcss.com/docs/upgrade-guide) and try following the additional steps in [Updating CSS class names for v4](#updating-css-class-names-for-v4).
|
172
173
|
|
173
174
|
|
174
|
-
### Troubleshooting
|
175
|
+
### Troubleshooting a v4 upgrade
|
175
176
|
|
176
177
|
You may want to check out [TailwindCSS v4 - upgrade experience report · rails/tailwindcss-rails · Discussion #450](https://github.com/rails/tailwindcss-rails/discussions/450) if you're having trouble upgrading.
|
177
178
|
|
@@ -195,7 +196,7 @@ With some additional manual work the upstream upgrade tool will update your appl
|
|
195
196
|
/node_modules
|
196
197
|
```
|
197
198
|
|
198
|
-
**Create** a `package.json` in the root of the project:
|
199
|
+
**Create** or **update** a `package.json` in the root of the project:
|
199
200
|
|
200
201
|
```jsonc
|
201
202
|
{
|
@@ -232,7 +233,9 @@ With some additional manual work the upstream upgrade tool will update your appl
|
|
232
233
|
|
233
234
|
Then, once you've run that successfully, clean up:
|
234
235
|
|
235
|
-
- **
|
236
|
+
- **Review** `package.json` to remove unnecessary modules.
|
237
|
+
- This includes modules added for the period of upgrade.
|
238
|
+
- If you don't need any modules besides `tailwindcss` itself, **delete** `package.json`, `node_modules/` and `package-lock.json` (or `yarn.lock`), plus remove `/node_modules` from `.gitignore`.
|
236
239
|
- **Go** to your CSS file and remove the following line (if present):
|
237
240
|
```css
|
238
241
|
@plugin '@tailwindcss/container-queries';
|
@@ -273,7 +276,6 @@ This gem also makes available a Puma plugin to manage a live rebuild process whe
|
|
273
276
|
|
274
277
|
This gem also generates a `Procfile.dev` file which will run both the rails server and a live rebuild process (see "Live Rebuild" section below).
|
275
278
|
|
276
|
-
|
277
279
|
### Building for production
|
278
280
|
|
279
281
|
The `tailwindcss:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Tailwind output will be generated.
|
@@ -286,8 +288,12 @@ The `tailwindcss:build` task is automatically attached to the `test:prepare` Rak
|
|
286
288
|
|
287
289
|
### Building unminified assets
|
288
290
|
|
289
|
-
If you want unminified assets, you can
|
291
|
+
If you want unminified assets, you can:
|
292
|
+
|
293
|
+
- pass a `debug` argument to the rake task, i.e. `rails tailwindcss:build[debug]` or `rails tailwindcss:watch[debug]`.
|
294
|
+
- set an environment variable named `TAILWINDCSS_DEBUG` with a non-blank value
|
290
295
|
|
296
|
+
If both values are set, the environment variable will take precedence over the rake task argument.
|
291
297
|
|
292
298
|
### Live rebuild
|
293
299
|
|
@@ -331,6 +337,32 @@ If you are running `rails tailwindcss:watch` in a docker container without a tty
|
|
331
337
|
Running `bin/dev` invokes Foreman to start both the Tailwind watch process and the rails server in development mode based on your `Procfile.dev` file.
|
332
338
|
|
333
339
|
|
340
|
+
### Using Tailwind plugins
|
341
|
+
|
342
|
+
If you want to use Tailwind plugins, they can be installed using `package.json`.
|
343
|
+
|
344
|
+
Using Yarn:
|
345
|
+
|
346
|
+
``` sh
|
347
|
+
[ ! -f package.json ] && yarn init
|
348
|
+
yarn add daisyui # example
|
349
|
+
```
|
350
|
+
|
351
|
+
Using npm:
|
352
|
+
|
353
|
+
``` sh
|
354
|
+
npm init
|
355
|
+
npm add daisyui # example
|
356
|
+
```
|
357
|
+
|
358
|
+
Than use `@plugin` annotation in `app/assets/tailwind/application.css`:
|
359
|
+
|
360
|
+
``` css
|
361
|
+
@import "tailwindcss";
|
362
|
+
@plugin "daisyui";
|
363
|
+
```
|
364
|
+
|
365
|
+
|
334
366
|
### Using with PostCSS
|
335
367
|
|
336
368
|
If you want to use PostCSS as a preprocessor, create a custom `postcss.config.js` in your project root directory, and that file will be loaded by Tailwind automatically.
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</div>
|
16
16
|
|
17
17
|
<div class="inline">
|
18
|
-
<%%= form.submit "Save", class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
18
|
+
<%%= form.submit "Save", class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
19
19
|
</div>
|
20
20
|
<%% end %>
|
21
21
|
</div>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="inline">
|
14
|
-
<%%= form.submit "Email reset instructions", class: "rounded-lg px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
14
|
+
<%%= form.submit "Email reset instructions", class: "w-full sm:w-auto text-center rounded-lg px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
15
15
|
</div>
|
16
16
|
<%% end %>
|
17
17
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
<div class="col-span-6 sm:flex sm:items-center sm:gap-4">
|
22
22
|
<div class="inline">
|
23
|
-
<%%= form.submit "Sign in", class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
23
|
+
<%%= form.submit "Sign in", class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="mt-4 text-sm text-gray-500 sm:mt-0">
|
@@ -38,6 +38,6 @@
|
|
38
38
|
|
39
39
|
<% end -%>
|
40
40
|
<div class="inline">
|
41
|
-
<%%= form.submit class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
41
|
+
<%%= form.submit class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
42
42
|
</div>
|
43
43
|
<%% end %>
|
@@ -5,6 +5,6 @@
|
|
5
5
|
|
6
6
|
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
7
7
|
|
8
|
-
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
8
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
10
10
|
</div>
|
@@ -13,13 +13,13 @@
|
|
13
13
|
<div id="<%= plural_table_name %>" class="min-w-full divide-y divide-gray-200 space-y-5">
|
14
14
|
<%% if @<%= plural_table_name %>.any? %>
|
15
15
|
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
16
|
-
<div class="flex justify-between items-center">
|
16
|
+
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
|
17
17
|
<%%= render <%= singular_table_name %> %>
|
18
|
-
<div class="space-x-2">
|
19
|
-
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
20
|
-
<%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
21
|
-
<div class="inline-block">
|
22
|
-
<%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
18
|
+
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
|
19
|
+
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
20
|
+
<%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
21
|
+
<div class="sm:inline-block">
|
22
|
+
<%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
</div>
|
@@ -5,5 +5,5 @@
|
|
5
5
|
|
6
6
|
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
7
7
|
|
8
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
8
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
9
9
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="<%%= dom_id <%= singular_name %> %>" class="my-5 space-y-5">
|
1
|
+
<div id="<%%= dom_id <%= singular_name %> %>" class="w-full sm:w-auto my-5 space-y-5">
|
2
2
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
3
|
<div>
|
4
4
|
<strong class="block font-medium mb-1"><%= attribute.human_name %>:</strong>
|
@@ -9,9 +9,9 @@
|
|
9
9
|
|
10
10
|
<%%= render @<%= singular_table_name %> %>
|
11
11
|
|
12
|
-
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "
|
13
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
14
|
-
<div class="inline-block ml-2">
|
15
|
-
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "
|
12
|
+
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
13
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
14
|
+
<div class="sm:inline-block mt-2 sm:mt-0 sm:ml-2">
|
15
|
+
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
16
16
|
</div>
|
17
17
|
</div>
|
data/lib/tailwindcss/commands.rb
CHANGED
data/lib/tailwindcss/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailwindcss-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02
|
10
|
+
date: 2025-03-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: railties
|