tailwindcss-rails 2.2.0-aarch64-linux → 2.3.0-aarch64-linux

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: 5ea5aab972a3dc03dfcf031ee7842eff5243fa2314352ed782015ddfa6594e60
4
- data.tar.gz: 64217909c0d2e1674cbedea144568f0455f33386033f9436c99cc35d4634ca50
3
+ metadata.gz: db79fd397c42829978451973f252e9912be2cacef1ddcda0267747098b4c4c8e
4
+ data.tar.gz: 294e7a55b1645515787aa4e2e84273592fa0ce7e942cfda2ed1f1d4f75cc7b8c
5
5
  SHA512:
6
- metadata.gz: 260ec6b9a1d983dc7037324dbe423071cd474b76c19372f5eba51dd836da88a2cec2e1c60aae801aed25e8deffb81f6307ba380f82bef62a115765016f2a2f29
7
- data.tar.gz: e1724de8a373c6bb73da7449206a0a8e027199cef3475e03975656fea6de18b01eab47f4f516de8ef311fd7bd6b156a8c1cbc665fc6553ee906283539c256227
6
+ metadata.gz: c4cba2f4a8228ccd77e1ab2f092eda6b60325931e81ecddb9d9fccfd8d8793ae9a305d1c5658c611da6725abc73e4193bb073aaac64dc7a7a7bf69baea93e3a5
7
+ data.tar.gz: 1dc27be70e0d892a3f49bf73ade30e2d5c6575db88a1b14b1920855e2da6bb0eea33a7b3bccb570f0cf19248b5c02871477ffeb632f1f77bba03e516802b1f89
data/README.md CHANGED
@@ -38,7 +38,6 @@ This also works with relative paths. If you've installed into your app's directo
38
38
  TAILWINDCSS_INSTALL_DIR=node_modules/.bin
39
39
  ```
40
40
 
41
-
42
41
  ## Developing with Tailwindcss
43
42
 
44
43
  ### Configuration
@@ -100,6 +99,24 @@ If you want unminified assets, you can pass a `debug` argument to the rake task,
100
99
  Note that you can combine task options, e.g. `rails tailwindcss:watch[debug,poll]`.
101
100
 
102
101
 
102
+ ### Using with PostCSS
103
+
104
+ If you want to use PostCSS as a preprocessor, create a custom `config/postcss.config.js` and it will be loaded automatically.
105
+
106
+ For example, to enable nesting:
107
+
108
+ ```js
109
+ // config/postcss.config.js
110
+ module.exports = {
111
+ plugins: {
112
+ 'postcss-import': {},
113
+ 'tailwindcss/nesting': {},
114
+ tailwindcss: {},
115
+ autoprefixer: {},
116
+ },
117
+ }
118
+ ```
119
+
103
120
  ### Custom inputs or outputs
104
121
 
105
122
  If you need to use a custom input or output file, you can run `bundle exec tailwindcss` to access the platform-specific executable, and give it your own build options.
@@ -192,6 +209,12 @@ The inline version also works:
192
209
  <section class="bg-[url('image.svg')]">Has the image as it's background</section>
193
210
  ```
194
211
 
212
+ ### Conflict with pre-existing asset pipeline stylesheets
213
+
214
+ If you get a warning `Unrecognized at-rule or error parsing at-rule ‘@tailwind’.` in the browser console after installation, you incorrectly double-process `application.tailwind.css`. This is a misconfiguration, even though the styles will be fully effective in many cases. The file `application.tailwind.css` is installed when running `rails tailwindcss:install` and is placed alongside the common `application.css` in `app/assets/stylesheets`. Because the `application.css` in a newly generated Rails app includes a `require_tree .` directive, the asset pipeline incorrectly processes `application.tailwind.css`, where it should be taken care of by `tailwindcss`. The asset pipeline ignores TailwindCSS's at-directives, and the browser can't process them.
215
+
216
+ To fix the warning, you can either remove the `application.css`, if you don't plan to use the asset pipeline for stylesheets, and instead rely on TailwindCSS completely for styles. This is what this installer assumes. Else, if you do want to keep using the asset pipeline in parallel, make sure to remove the `require_tree .` line from the `application.css`.
217
+
195
218
  ## License
196
219
 
197
220
  Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
Binary file
@@ -3,7 +3,8 @@ require "rails/generators/erb/controller/controller_generator"
3
3
  module Tailwindcss
4
4
  module Generators
5
5
  class ControllerGenerator < Erb::Generators::ControllerGenerator
6
- source_root File.expand_path("../templates", __FILE__)
6
+ source_root File.expand_path("templates", __dir__)
7
+ source_paths << "lib/templates/erb/controller"
7
8
  end
8
9
  end
9
10
  end
@@ -3,7 +3,8 @@ require "rails/generators/erb/mailer/mailer_generator"
3
3
  module Tailwindcss
4
4
  module Generators
5
5
  class MailerGenerator < Erb::Generators::MailerGenerator
6
- source_root File.expand_path("../templates", __FILE__)
6
+ source_root File.expand_path("templates", __dir__)
7
+ source_paths << "lib/templates/erb/mailer"
7
8
  end
8
9
  end
9
10
  end
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%%= yield %>
12
+ </body>
13
+ </html>
@@ -6,7 +6,8 @@ module Tailwindcss
6
6
  class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
7
7
  include Rails::Generators::ResourceHelpers
8
8
 
9
- source_root File.expand_path("../templates", __FILE__)
9
+ source_root File.expand_path("templates", __dir__)
10
+ source_paths << "lib/templates/erb/scaffold"
10
11
 
11
12
  argument :attributes, type: :array, default: [], banner: "field:type field:type"
12
13
 
@@ -15,7 +15,7 @@
15
15
  <div class="my-5">
16
16
  <% if attribute.password_digest? -%>
17
17
  <%%= form.label :password %>
18
- <%%= form.password_field :password %>
18
+ <%%= form.password_field :password, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
19
19
  </div>
20
20
 
21
21
  <div class="my-5">
@@ -74,14 +74,19 @@ module Tailwindcss
74
74
  end
75
75
 
76
76
  def compile_command(debug: false, **kwargs)
77
- [
77
+ command = [
78
78
  executable(**kwargs),
79
79
  "-i", Rails.root.join("app/assets/stylesheets/application.tailwind.css").to_s,
80
80
  "-o", Rails.root.join("app/assets/builds/tailwind.css").to_s,
81
81
  "-c", Rails.root.join("config/tailwind.config.js").to_s,
82
- ].tap do |command|
83
- command << "--minify" unless (debug || rails_css_compressor?)
84
- end
82
+ ]
83
+
84
+ command << "--minify" unless (debug || rails_css_compressor?)
85
+
86
+ postcss_path = Rails.root.join("config/postcss.config.js")
87
+ command += ["--postcss", postcss_path.to_s] if File.exist?(postcss_path)
88
+
89
+ command
85
90
  end
86
91
 
87
92
  def watch_command(always: false, poll: false, **kwargs)
@@ -1,7 +1,7 @@
1
1
  module Tailwindcss
2
2
  # constants describing the upstream tailwindcss project
3
3
  module Upstream
4
- VERSION = "v3.4.0"
4
+ VERSION = "v3.4.1"
5
5
 
6
6
  # rubygems platform name => upstream release filename
7
7
  NATIVE_PLATFORMS = {
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwindcss-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-04 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -58,6 +58,8 @@ files:
58
58
  - lib/generators/tailwindcss/controller/controller_generator.rb
59
59
  - lib/generators/tailwindcss/controller/templates/view.html.erb.tt
60
60
  - lib/generators/tailwindcss/mailer/mailer_generator.rb
61
+ - lib/generators/tailwindcss/mailer/templates/layout.html.erb.tt
62
+ - lib/generators/tailwindcss/mailer/templates/layout.text.erb.tt
61
63
  - lib/generators/tailwindcss/mailer/templates/view.html.erb.tt
62
64
  - lib/generators/tailwindcss/mailer/templates/view.text.erb.tt
63
65
  - lib/generators/tailwindcss/scaffold/scaffold_generator.rb