tailwindcss-rails 4.0.0 → 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30675a62d715227df3d53c507a3f20b95d1a7ec993d5dc58a5a346d687cb732f
4
- data.tar.gz: 5d48adc3bd62d127bcb5618d3156ac6e7c1413acace42fc804df2d1e4eb17fe3
3
+ metadata.gz: 8dfb2a9007c58419791262f3e6161df3aefbec1bb74f513c87404c01135751c2
4
+ data.tar.gz: 9339a008fff18d68721d9958fbea1d98b80825fb18f502d7394092e77a3c3d9c
5
5
  SHA512:
6
- metadata.gz: b145598cdc5c279835e5e9f03ca8905b74d5da65d865e276eb5c4d53b6af8e1a491dceec08b0720789c3bc873839ab19b4bee31cd306224e308dc3cab3df998f
7
- data.tar.gz: 249e0738be704d1bc886bc20cb001a1345b5e4b1b562a3bcda91cd27ab72c9a22af4ca26de1f2502a00e8d1697a1006c30b932a27bf562d3c23c63896fe4cb68
6
+ metadata.gz: 86735d4c0a54258a459a0a9aab3ad5e53d738e1cf195bc6ee0b9554505c53417749e481212f17d0f5462516f0b84f8f6846606706cff315e4f9ba7923039615b
7
+ data.tar.gz: c299cf5e88698b34a0b1c64bad13d752af44a681628b85752bbfe7f098c8a6c31bb111ae49b566084c444eda92efc7df45f60d5a2ef6eb2e6068857facb06e40
data/README.md CHANGED
@@ -104,6 +104,13 @@ First, update to `tailwindcss-rails` v4.0.0 or higher. This will also ensure you
104
104
  gem "tailwindcss-rails", "~> 4.0" # which transitively pins tailwindcss-ruby to v4
105
105
  ```
106
106
 
107
+ **Update** path references to any existing css files imported in `app/assets/stylesheets/application.tailwind.css` so that they will resolve when the file is moved to `app/assets/tailwind/application.css`.
108
+
109
+ ```diff
110
+ -@import "pagy.css";
111
+ +@import "../stylesheets/pagy.css";
112
+ ```
113
+
107
114
  If you want to migrate CSS class names for v4 (this is an optional step!), jump to [Updating CSS class names for v4](#updating-css-class-names-for-v4) before continuing.
108
115
 
109
116
  Then, run `bin/rails tailwindcss:upgrade`. Among other things, this will try to run the official Tailwind upgrade utility. It requires `npx` in order to run, but it's a one-time operation and is *highly recommended* for a successful upgrade.
@@ -232,7 +239,6 @@ Then, once you've run that successfully, clean up:
232
239
  ```
233
240
  - **Revert** the changes to `config/tailwind.config.js` so that paths are once again relative to the application root.
234
241
 
235
-
236
242
  ## Developing with Tailwindcss
237
243
 
238
244
  ### Configuration and commands
@@ -391,7 +397,7 @@ See https://github.com/flavorjones/tailwindcss-ruby for help.
391
397
 
392
398
  ### Using asset-pipeline assets
393
399
 
394
- In Rails, you want to use [assets from the asset pipeline to get fingerprinting](https://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark). However, Tailwind isn't aware of those assets.
400
+ In Rails, you want to use [assets from the asset pipeline to get fingerprinting](https://guides.rubyonrails.org/asset_pipeline.html#fingerprinting-versioning-with-digest-based-urls). However, Tailwind isn't aware of those assets.
395
401
 
396
402
  To use assets from the pipeline, use `url(image.svg)`. [Since Sprockets v3.3.0](https://github.com/rails/sprockets-rails/pull/476) `url(image.svg)` is rewritten to `/path/to/assets/image-7801e7538c6f1cc57aa75a5876ab0cac.svg` so output CSS will have the correct path to those assets.
397
403
 
@@ -416,4 +422,3 @@ The inline version also works:
416
422
  ## License
417
423
 
418
424
  Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
419
- The Inter font is released under the [SIL Open Font License, Version 1.1](https://github.com/rsms/inter/blob/master/LICENSE.txt).
@@ -7,11 +7,11 @@
7
7
 
8
8
  <%%= form_with url: password_path(params[:token]), method: :put, class: "contents" do |form| %>
9
9
  <div class="my-5">
10
- <%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
10
+ <%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
11
11
  </div>
12
12
 
13
13
  <div class="my-5">
14
- <%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
14
+ <%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
15
15
  </div>
16
16
 
17
17
  <div class="inline">
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%%= form_with url: passwords_path, class: "contents" do |form| %>
9
9
  <div class="my-5">
10
- <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow-sm rounded-md border border-gray-400 outline-hidden focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
10
+ <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow-sm rounded-md border border-gray-400 focus:outline-solid focus:outline-blue-600 px-3 py-2 mt-2 w-full" %>
11
11
  </div>
12
12
 
13
13
  <div class="inline">
@@ -12,26 +12,26 @@
12
12
  <%% end %>
13
13
 
14
14
  <% attributes.each do |attribute| -%>
15
- <div class="my-5">
15
+ <div class="my-5<%= " flex items-center gap-2" if attribute.field_type == :checkbox || attribute.field_type == :check_box %>">
16
16
  <% if attribute.password_digest? -%>
17
17
  <%%= form.label :password %>
18
- <%%= form.password_field :password, class: ["block shadow-sm rounded-md border outline-hidden px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
18
+ <%%= form.password_field :password, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
19
19
  </div>
20
20
 
21
21
  <div class="my-5">
22
22
  <%%= form.label :password_confirmation %>
23
- <%%= form.password_field :password_confirmation, class: ["block shadow-sm rounded-md border outline-hidden px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password_confirmation].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password_confirmation].any?}] %>
23
+ <%%= form.password_field :password_confirmation, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password_confirmation].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password_confirmation].any?}] %>
24
24
  <% elsif attribute.attachments? -%>
25
25
  <%%= form.label :<%= attribute.column_name %> %>
26
- <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: ["block shadow-sm rounded-md border outline-hidden px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
26
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
27
27
  <% else -%>
28
28
  <%%= form.label :<%= attribute.column_name %> %>
29
29
  <% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
30
- <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow-sm rounded-md border outline-hidden px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
30
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
31
31
  <% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%>
32
- <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border outline-hidden mt-2 h-5 w-5", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
32
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border order-first h-5 w-5", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
33
33
  <% else -%>
34
- <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border outline-hidden px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
34
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
35
35
  <% end -%>
36
36
  <% end -%>
37
37
  </div>
@@ -10,13 +10,19 @@
10
10
  <%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
11
11
  </div>
12
12
 
13
- <div id="<%= plural_table_name %>" class="min-w-full">
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
- <%%= render <%= singular_table_name %> %>
17
- <p>
18
- <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
19
- </p>
16
+ <div class="flex justify-between items-center">
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?" } %>
23
+ </div>
24
+ </div>
25
+ </div>
20
26
  <%% end %>
21
27
  <%% else %>
22
28
  <p class="text-center my-10">No <%= human_name.downcase.pluralize %> found.</p>
@@ -1,16 +1,18 @@
1
- <div id="<%%= dom_id <%= singular_name %> %>">
1
+ <div id="<%%= dom_id <%= singular_name %> %>" class="my-5 space-y-5">
2
2
  <% attributes.reject(&:password_digest?).each do |attribute| -%>
3
- <p class="my-5">
3
+ <div>
4
4
  <strong class="block font-medium mb-1"><%= attribute.human_name %>:</strong>
5
5
  <% if attribute.attachment? -%>
6
- <%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached? %>
6
+ <%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %>, class: "text-gray-700 underline hover:no-underline" if <%= singular_name %>.<%= attribute.column_name %>.attached? %>
7
7
  <% elsif attribute.attachments? -%>
8
8
  <%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
9
- <div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
9
+ <div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %>, class: "text-gray-700 underline hover:no-underline" %></div>
10
10
  <%% end %>
11
+ <% elsif attribute.type == :boolean -%>
12
+ <%%= <%= singular_name %>.<%= attribute.column_name %>? ? "Yes" : "No" %>
11
13
  <% else -%>
12
14
  <%%= <%= singular_name %>.<%= attribute.column_name %> %>
13
15
  <% end -%>
14
- </p>
16
+ </div>
15
17
  <% end -%>
16
18
  </div>
@@ -12,6 +12,6 @@
12
12
  <%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "mt-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
13
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
14
  <div class="inline-block ml-2">
15
- <%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium" %>
15
+ <%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 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>
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "4.0.0"
2
+ VERSION = "4.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwindcss-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-02-01 00:00:00.000000000 Z
10
+ date: 2025-02-19 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: railties
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '4.0'
41
- description:
42
40
  email: david@loudthinking.com
43
41
  executables: []
44
42
  extensions: []
@@ -111,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
109
  - !ruby/object:Gem::Version
112
110
  version: 3.2.0
113
111
  requirements: []
114
- rubygems_version: 3.5.22
115
- signing_key:
112
+ rubygems_version: 3.6.2
116
113
  specification_version: 4
117
114
  summary: Integrate Tailwind CSS with the asset pipeline in Rails.
118
115
  test_files: []