diff --git a/Gemfile.lock b/Gemfile.lock index 32cb5b5..7e1c0c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tailwindcss-rails (3.0.0) + tailwindcss-rails (3.1.0) railties (>= 7.0.0) tailwindcss-ruby diff --git a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb index 4ea2c81..707bbe5 100644 --- a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb +++ b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb @@ -15,7 +15,7 @@
- <%%= form.submit "Save", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> + <%%= 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" %>
<%% end %> diff --git a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb index 2e7b1e9..72c434d 100644 --- a/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb +++ b/lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb @@ -11,7 +11,7 @@
- <%%= form.submit "Email reset instructions", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> + <%%= 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" %>
<%% end %> diff --git a/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb b/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb index 5176bc8..92d64b7 100644 --- a/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb +++ b/lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb @@ -20,11 +20,11 @@
- <%%= form.submit "Sign in", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> + <%%= 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" %>
- <%%= link_to "Forgot password?", new_password_path, class: "text-gray-700 underline" %> + <%%= link_to "Forgot password?", new_password_path, class: "text-gray-700 underline hover:no-underline" %>
<%% end %> diff --git a/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt index c76993b..93490a1 100644 --- a/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt @@ -1,9 +1,9 @@ <%%= form_with(model: <%= model_resource_name %>, class: "contents") do |form| %> <%% if <%= singular_table_name %>.errors.any? %> -
+

<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:

-
-
+
<%%= form.label :password_confirmation %> - <%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> + <%%= form.password_field :password_confirmation, class: ["block shadow rounded-md border outline-none 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?}] %> <% elsif attribute.attachments? -%> <%%= form.label :<%= attribute.column_name %> %> - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: ["block shadow rounded-md border outline-none 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?}] %> <% else -%> <%%= form.label :<%= attribute.column_name %> %> <% if attribute.field_type == :textarea || attribute.field_type == :text_area -%> - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow rounded-md border outline-none 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?}] %> <% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%> - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 mt-2 h-5 w-5" %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow rounded-md border outline-none 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?}] %> <% else -%> - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow rounded-md border outline-none 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?}] %> <% end -%> <% end -%>
<% end -%>
- <%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> + <%%= 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" %>
<%% end %> diff --git a/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt index fab779d..74edd3d 100644 --- a/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt @@ -1,8 +1,10 @@ -
+<%% content_for :title, "Editing <%= human_name.downcase %>" %> + +

Editing <%= human_name.downcase %>

<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %> - <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= 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" %> + <%%= 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" %>
diff --git a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt index 65cf06b..3d337f9 100644 --- a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt @@ -1,21 +1,25 @@ +<%% content_for :title, "<%= human_name.pluralize %>" %> +
<%% if notice.present? %> -

<%%= notice %>

+

<%%= notice %>

<%% end %> - <%% content_for :title, "<%= human_name.pluralize %>" %> -

<%= human_name.pluralize %>

- <%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> + <%%= 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" %>
- <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> - <%%= render <%= singular_table_name %> %> -

- <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> -

+ <%% if @<%= plural_table_name %>.any? %> + <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> + <%%= render <%= singular_table_name %> %> +

+ <%%= 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" %> +

+ <%% end %> + <%% else %> +

No <%= human_name.downcase.pluralize %> found.

<%% end %>
diff --git a/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt index 665532e..0a10d96 100644 --- a/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt @@ -1,7 +1,9 @@ -
+<%% content_for :title, "New <%= human_name.downcase %>" %> + +

New <%= human_name.downcase %>

<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %> - <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%%= 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" %>
diff --git a/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt index e1a4547..88dc3ed 100644 --- a/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt @@ -12,6 +12,5 @@ <%%= <%= singular_name %>.<%= attribute.column_name %> %> <% end -%>

- <% end -%>
diff --git a/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt index 17d0feb..3a49e9a 100644 --- a/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt @@ -1,15 +1,17 @@ -
-
- <%% if notice.present? %> -

<%%= notice %>

- <%% end %> - - <%%= render @<%= singular_table_name %> %> - - <%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> -
- <%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> -
+<%% content_for :title, "Showing <%= human_name.downcase %>" %> + +
+ <%% if notice.present? %> +

<%%= notice %>

+ <%% end %> + +

Showing <%= human_name.downcase %>

+ + <%%= render @<%= singular_table_name %> %> + + <%%= 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" %> + <%%= 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" %> +
+ <%%= 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" %>