tailwindcss-rails 2.2.1-x86_64-linux → 2.3.0-x86_64-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: 8c229e1a8d973f606179204d10edfd982dd74f8e12cd1b1ffe5acb943d7a5bf6
4
- data.tar.gz: 40fd46f5fd7bcd54f17b99f07d29fb1a0c288d4133da325f782ef8bda55bf984
3
+ metadata.gz: 96b74d2378689e927abcb48f1ddcfb82d639272e7c928ae8c07e551f325bfde7
4
+ data.tar.gz: 897f6e5c2002412b5b4f752c60e0424bb1f484ac6f9435995cc4ce4fcb95345b
5
5
  SHA512:
6
- metadata.gz: 0a4ff6d5824bfd52111c56f3415a6645a5279cfb157b7907d9e99da54d0200b7df917a36664e19ae91025f976ff75cd2a454bc14d6cd82baa94ea1ffef4f9b94
7
- data.tar.gz: 993ee186ed9075fbba8ec68d88da543ffecdd5e17cb11d2478f4adab50f64e8746933c6495f33e0b91903762978783887c8531649e55110cb7df90ec36de33ef
6
+ metadata.gz: 71a8869ba5da3f22011b167f3b46c2f88fad23f82802086cfb011f28c63bb247fa1467bab3c52c2537434e1418c4137b2b2a50ba51e99c382aef40372a1cf95c
7
+ data.tar.gz: 9fdbf8b8cdc3c872d45c6d829d3dca98ce7c5cedb374ccc31df92742302dddfd2bfc840236fce53d47ae1e2d79ed56b4f3bf9a1cce243c0c01ab607084d91574
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.
@@ -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
@@ -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
 
@@ -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,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "2.2.1"
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.1
4
+ version: 2.3.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-08 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