tailwindcss-rails 0.5.0 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efa9c7fbb61dc459247b3af68e46e47b8c002d925635d27e9ed48d0b6f8d6597
4
- data.tar.gz: f4126ae45ea113f4a915308accabd4d7467fc6de364ec68fe412a8ae540d3942
3
+ metadata.gz: 034611e8ea49f35f8fb1f8c04e2a838011cf60f0a3ed532e583f8557b680f505
4
+ data.tar.gz: 0ec0ffa66dbd906af1021d53e533f448949d48f605505ace7ad04c6d4fa3d557
5
5
  SHA512:
6
- metadata.gz: f1a0c5c9d258f268f109d780a0c0b12f87779557ec859b1f50e94b602de607e0edbc99d93ce18498a3855c19dea5e0b9ea11c88dff15bc813650b0ba7f330ec1
7
- data.tar.gz: 4c6a0bb1fdead9026be4934083af4e49ef053dcc4d1f1aead35d1db024cb4a01268784732287ac333689a936df53dc013082f6cce2b5d85ab958aefcc9e53e5c
6
+ metadata.gz: bfe791a46dfad464601c97c582dffcc415aae9525602bf892f6fafeb6aca3ba1f799161d5967958f0b3ad03201ca0537978f75add6afb64435cdb79372056d1f
7
+ data.tar.gz: 67bca0ab9ccaab58eecbc021175b79dfdab7df5bad4a8fbde909fc957c85516521260b6a3252fbfe7d16ab3bc99d12e7bfb018a851165bb82d9c5a8412c40627
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [Tailwind CSS](https://tailwindcss.com) is a utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup.
4
4
 
5
- This gem gives access to the standard Tailwind CSS framework configured for dark mode, forms, aspect-ratio, typography, and the Inter font via the asset pipeline using Sprockets. If you need to customize Tailwind, you will need to install it the traditional way using [Webpacker](https://github.com/rails/webpacker) instead or use webpacker port of this gem [tailwindcss-rails-webpacker](https://github.com/WizardComputer/tailwindcss-rails-webpacker).
5
+ This gem gives access to the standard Tailwind CSS framework configured for dark mode, forms, aspect-ratio, typography, and the Inter font via the asset pipeline using Sprockets (and soon [Propshaft](https://github.com/rails/propshaft)).
6
+
7
+ If you need to customize Tailwind, you will need to install it under a full JavaScript bundling setup, such as [cssbundling-rails](https://github.com/rails/cssbundling-rails). This gem was specifically designed not to require a Node.js environment. If you're already using such an environment, you won't need this gem.
6
8
 
7
9
  Production-mode purging of unused css class names is provided by a Sprockets compressor built into this gem. This compressor ensures that only the css classes used by files in `app/views` and `app/helpers` are included. In development mode, the full 7mb+ Tailwind stylesheet is loaded.
8
10
 
data/Rakefile CHANGED
@@ -8,6 +8,7 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.libs << 'test'
9
9
  t.pattern = 'test/**/*_test.rb'
10
10
  t.verbose = false
11
+ t.warning = true
11
12
  end
12
13
 
13
14
  task default: :test
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v2.2.16 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com */
2
2
 
3
3
  /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
4
4
 
@@ -0,0 +1,9 @@
1
+ require "rails/generators/erb/controller/controller_generator"
2
+
3
+ module Tailwindcss
4
+ module Generators
5
+ class ControllerGenerator < Erb::Generators::ControllerGenerator
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ <div>
2
+ <h1 class="text-lg font-bold text-4xl"><%= class_name %>#<%= @action %></h1>
3
+ <p>Find me in <%= @path %></p>
4
+ </div>
@@ -0,0 +1,9 @@
1
+ require "rails/generators/erb/mailer/mailer_generator"
2
+
3
+ module Tailwindcss
4
+ module Generators
5
+ class MailerGenerator < Erb::Generators::MailerGenerator
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ <h1><%= class_name %>#<%= @action %></h1>
2
+
3
+ <p>
4
+ <%%= @greeting %>, find me in <%= @path %>
5
+ </p>
@@ -0,0 +1,3 @@
1
+ <%= class_name %>#<%= @action %>
2
+
3
+ <%%= @greeting %>, find me in <%= @path %>
@@ -38,6 +38,6 @@
38
38
 
39
39
  <% end -%>
40
40
  <div class="inline">
41
- <%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium" %>
41
+ <%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
42
42
  </div>
43
43
  <%% end %>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <%%= link_to 'Edit this <%= singular_table_name %>', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
10
10
  <div class="inline-block ml-2">
11
- <%%= button_to 'Delete this <%= singular_table_name %>', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: "Are you sure you want to delete this <%= singular_table_name %>?" }, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
11
+ <%%= button_to 'Destroy this <%= singular_table_name %>', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: "Are you sure you want to delete this <%= singular_table_name %>?" }, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
12
12
  </div>
13
13
  <%%= link_to 'Back to <%= plural_table_name %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
14
14
  </div>
@@ -10,8 +10,8 @@ class Tailwindcss::Compressor
10
10
  end
11
11
 
12
12
  def initialize(options = {})
13
- @options = {
14
- files_with_class_names: Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb"),
13
+ @options = {
14
+ files_with_class_names: files_with_class_names,
15
15
  only_purge: %w[ tailwind ]
16
16
  }.merge(options).freeze
17
17
  end
@@ -23,4 +23,11 @@ class Tailwindcss::Compressor
23
23
  input[:data]
24
24
  end
25
25
  end
26
+
27
+ private
28
+ def files_with_class_names
29
+ Rails.root.glob("app/views/**/*.*") +
30
+ Rails.root.glob("app/helpers/**/*.rb") +
31
+ Rails.root.glob("app/javascript/**/*.js")
32
+ end
26
33
  end
@@ -1,3 +1,4 @@
1
+ require "rails"
1
2
  require "tailwindcss/compressor"
2
3
 
3
4
  module Tailwindcss
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwindcss-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2021-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -51,6 +51,11 @@ files:
51
51
  - app/assets/fonts/Inter-roman.vietnamese.var.woff2
52
52
  - app/assets/stylesheets/inter-font.css.erb
53
53
  - app/assets/stylesheets/tailwind.css
54
+ - lib/generators/tailwindcss/controller/controller_generator.rb
55
+ - lib/generators/tailwindcss/controller/templates/view.html.erb.tt
56
+ - lib/generators/tailwindcss/mailer/mailer_generator.rb
57
+ - lib/generators/tailwindcss/mailer/templates/view.html.erb.tt
58
+ - lib/generators/tailwindcss/mailer/templates/view.text.erb.tt
54
59
  - lib/generators/tailwindcss/scaffold/scaffold_generator.rb
55
60
  - lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt
56
61
  - lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt
@@ -85,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
90
  - !ruby/object:Gem::Version
86
91
  version: '0'
87
92
  requirements: []
88
- rubygems_version: 3.1.4
93
+ rubygems_version: 3.2.32
89
94
  signing_key:
90
95
  specification_version: 4
91
96
  summary: Integrate Tailwind CSS with the asset pipeline in Rails.