cssbundling-rails 1.4.0 → 1.4.2
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 +4 -4
- data/README.md +12 -6
- data/lib/cssbundling/version.rb +1 -1
- data/lib/install/dev +1 -1
- data/lib/install/helpers.rb +4 -0
- data/lib/install/install.rb +1 -1
- data/lib/install/tailwind/application.tailwind.css +1 -3
- data/lib/install/tailwind/install.rb +3 -4
- data/lib/install/tailwind/package.json +1 -1
- metadata +5 -5
- data/lib/install/tailwind/tailwind.config.js +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a66c0e0cc7f1112643a6c720f3f44ad0cd5f755bcf041a20c457b85dcc1d4399
|
4
|
+
data.tar.gz: 583f803ecef9faf25ae086b134124bee3f20bf518fb3134c376ec07e214c60f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf563e95e2d5bb3649fd863ad960b8442cad65283671bb2546f43cd35e0f26000ae99b4495c5b665aad99c8051be1a69cf4a4c6706afc9506aba93691ff8ac7f
|
7
|
+
data.tar.gz: fb26b6ec28b4d8e87f8e2df215da00c923f7601c7d5112a4486af99241347f6ab2cbe0f02292f991270faa2813fd81ed82a932658c6522a3881e86169f006ec7
|
data/README.md
CHANGED
@@ -12,8 +12,7 @@ This also happens in testing where the bundler attaches to the `test:prepare` ta
|
|
12
12
|
|
13
13
|
That's it!
|
14
14
|
|
15
|
-
You can configure your bundler options in the `build:css` script in `package.json` or
|
16
|
-
|
15
|
+
You can configure your bundler options in the `build:css` script in `package.json` or `postcss.config.js` for PostCSS.
|
17
16
|
|
18
17
|
## Installation
|
19
18
|
|
@@ -22,8 +21,7 @@ You must already have node and yarn installed on your system. You will also need
|
|
22
21
|
1. Run `./bin/bundle add cssbundling-rails`
|
23
22
|
2. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]`
|
24
23
|
|
25
|
-
Or, in Rails 7+, you can preconfigure your new application to use
|
26
|
-
|
24
|
+
Or, in Rails 7+, you can preconfigure your new application to use `cssbundling-rails` for `bootstrap`, `bulma` or `postcss` with `rails new myapp --css [bootstrap|bulma|postcss]`.
|
27
25
|
|
28
26
|
## FAQ
|
29
27
|
|
@@ -31,9 +29,17 @@ Or, in Rails 7+, you can preconfigure your new application to use a specific bun
|
|
31
29
|
|
32
30
|
If you're already relying on Node to process your JavaScript, this gem is the way to go. But if you're using [the default import map setup in Rails 7+](https://github.com/rails/importmap-rails/), you can avoid having to deal with Node at all by using the standalone versions of Tailwind CSS and Dart Sass that are available through [tailwindcss-rails](https://github.com/rails/tailwindcss-rails/) and [dartsass-rails](https://github.com/rails/dartsass-rails/). It's simpler, fewer moving parts, and still has all the functionality.
|
33
31
|
|
32
|
+
In Rails 7+, you can preconfigure your new application to use `tailwindcss-rails` and `dartsass-rails` with `rails new myapp --css [tailwind|sass]`.
|
33
|
+
|
34
34
|
### How do I import relative CSS files with Tailwind?
|
35
35
|
|
36
|
-
|
36
|
+
Tailwind CSS 4 is configured using native CSS. Instead of bundling all your CSS into a single file, consider referencing individual CSS files directly. This approach simplifies setup and improves caching performance. To reference multiple CSS files in Rails, update the stylesheet_link_tag in application.html.erb like this:
|
37
|
+
|
38
|
+
```erb
|
39
|
+
<%= stylesheet_link_tag "application", "other", "styles", "data-turbo-track": "reload" %>
|
40
|
+
```
|
41
|
+
|
42
|
+
This ensures your files are properly linked and ready to use.
|
37
43
|
|
38
44
|
### How do I avoid SassC::SyntaxError exceptions on existing projects?
|
39
45
|
|
@@ -57,7 +63,7 @@ Rails.application.config.assets.css_compressor = nil
|
|
57
63
|
Watch out - if you precompile your files locally, those will be served over the dynamically created ones you expect. The solution:
|
58
64
|
|
59
65
|
```shell
|
60
|
-
rails assets:clobber
|
66
|
+
rails assets:clobber
|
61
67
|
```
|
62
68
|
|
63
69
|
### How do I include 3rd party stylesheets from `node_modules` in my bundle?
|
data/lib/cssbundling/version.rb
CHANGED
data/lib/install/dev
CHANGED
data/lib/install/helpers.rb
CHANGED
data/lib/install/install.rb
CHANGED
@@ -3,11 +3,10 @@ self.extend Helpers
|
|
3
3
|
|
4
4
|
apply "#{__dir__}/../install.rb"
|
5
5
|
|
6
|
-
say "Install Tailwind
|
7
|
-
copy_file "#{__dir__}/tailwind.config.js", "tailwind.config.js"
|
6
|
+
say "Install Tailwind"
|
8
7
|
copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/application.tailwind.css"
|
9
|
-
run "#{bundler_cmd} add tailwindcss@latest
|
8
|
+
run "#{bundler_cmd} add tailwindcss@latest @tailwindcss/cli@latest"
|
10
9
|
|
11
10
|
say "Add build:css script"
|
12
11
|
add_package_json_script "build:css",
|
13
|
-
"tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
|
12
|
+
"#{bundler_x_cmd} @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"name": "app",
|
3
3
|
"private": "true",
|
4
4
|
"scripts": {
|
5
|
-
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css"
|
5
|
+
"build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css"
|
6
6
|
}
|
7
7
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cssbundling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -54,14 +54,14 @@ files:
|
|
54
54
|
- lib/install/tailwind/application.tailwind.css
|
55
55
|
- lib/install/tailwind/install.rb
|
56
56
|
- lib/install/tailwind/package.json
|
57
|
-
- lib/install/tailwind/tailwind.config.js
|
58
57
|
- lib/tasks/cssbundling/build.rake
|
59
58
|
- lib/tasks/cssbundling/clobber.rake
|
60
59
|
- lib/tasks/cssbundling/install.rake
|
61
60
|
homepage: https://github.com/rails/cssbundling-rails
|
62
61
|
licenses:
|
63
62
|
- MIT
|
64
|
-
metadata:
|
63
|
+
metadata:
|
64
|
+
changelog_uri: https://github.com/rails/cssbundling-rails/releases
|
65
65
|
post_install_message:
|
66
66
|
rdoc_options: []
|
67
67
|
require_paths:
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
80
|
+
rubygems_version: 3.5.22
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Bundle and process CSS with Tailwind, Bootstrap, PostCSS, Sass in Rails via
|