tailwindcss-rails 2.0.6 → 2.0.9

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: f3079cc567f402bd4f9f38c53e20e40d75d63aadf5b64b05d7c97593d275049f
4
- data.tar.gz: f5a28d5e46a0d80d4f2d1909e38761f3e801b82e579970010a5cd6cf53cc1a6c
3
+ metadata.gz: 5cbbe62062eac1dcdc83e1a7e829358e5be93a32076837515565483664c3d994
4
+ data.tar.gz: b2085b36482b7d3b6139c2a74470bbd6c7cba1ec4dbd7802793689831abae3cc
5
5
  SHA512:
6
- metadata.gz: 1b4146053ad12b5516c3689b2ce8100029dabb170ec382b50bffd0b8901e5203f3e7f43832f5b210860790b75f63f8de72217b58e6e81a54030ad1a0c526999b
7
- data.tar.gz: 8b5cef94fe6d2b19da9b526378abae42ddde2085e22c9fad2ef9df9bb5eb3a6e9fbb5e0e28c50cb8496249f8200b36f82a3e32067c09507f4f35fef861fd5aeb
6
+ metadata.gz: a3396fc63e0dd8fc740fa9c3e0b872b77a90992f4a9eed37c11f686aff7e54e25163fda7f77ed3a4e130967cf938f92dc71bc7ebfb6cb9472ac118d433534f34
7
+ data.tar.gz: 2f5095d2efc27ad75c987203bdb6a056f615200a8d1c060739a4a02c0bf9f6708b6db03f768ab5aa0bf24dfea995cc1bdd78035026ec54550a92c0fbbb1abd7f
data/README.md CHANGED
@@ -2,7 +2,7 @@
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 wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS 3 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform. Supported platforms are Linux x64, macOS arm64, macOS x64, and Windows x64. (Note that due to this setup, you must install the actual gems – you can't pin your gem to the github repo.)
5
+ This gem wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v3 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform. Supported platforms are Linux x64, macOS arm64, macOS x64, and Windows x64. (Note that due to this setup, you must install the actual gems – you can't pin your gem to the github repo.)
6
6
 
7
7
  You can customize the Tailwind build through the `config/tailwind.config.js` file, just like you would if Tailwind was running in a traditional node installation. All the first-party plugins are supported.
8
8
 
@@ -10,7 +10,7 @@ The installer will create your Tailwind input file in `app/assets/stylesheets/ap
10
10
 
11
11
  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.
12
12
 
13
- When you're developing your application, you want to run Tailwind in watch mode, so changes are automatically reflected in the generated CSS output. You can do this either by running `rails tailwindcss:watch` as a separate process, or by running `./bin/dev` which uses [foreman](https://github.com/ddollar/foreman) to starts both the Tailwind watch process and the rails server in development mode.
13
+ When you're developing your application, you want to run Tailwind in watch mode, so changes are automatically reflected in the generated CSS output. You can do this either by running `rails tailwindcss:watch` as a separate process, or by running `./bin/dev` which uses [foreman](https://github.com/ddollar/foreman) to starts both the Tailwind watch process and the rails server in development mode. If you are running `rails tailwindcss:watch` as a process in a Docker container, set `tty: true` in `docker-compose.yml` for the appropriate container to keep the watch process running.
14
14
 
15
15
 
16
16
  ## Installation
@@ -47,6 +47,7 @@ Some users are reporting this error even when running on one of the supported na
47
47
 
48
48
  - arm64-darwin
49
49
  - x64-mingw32
50
+ - x64-mingw-ucrt
50
51
  - x86_64-darwin
51
52
  - x86_64-linux
52
53
  - aarch64-linux
@@ -93,6 +94,27 @@ A fix for this has been proposed upstream at https://github.com/tailwindlabs/tai
93
94
  apk add build-base gcompat
94
95
  ```
95
96
 
97
+ ### Using asset-pipeline assets
98
+
99
+ In Rails, you want to use [assets from the asset pipeline to get fingerprinting](https://guides.rubyonrails.org/asset_pipeline.html#what-is-fingerprinting-and-why-should-i-care-questionmark). However, Tailwind isn't aware of those assets. To use assets from the pipeline, use `url(image.svg)`. [Since Sprockets v3.3.0](https://github.com/rails/sprockets-rails/pull/476) `url(image.svg)` will then automatically be rewritten to `/path/to/assets/image-7801e7538c6f1cc57aa75a5876ab0cac.svg`. So the output CSS will have the correct path to those assets.
100
+
101
+ ```js
102
+ module.exports = {
103
+ theme: {
104
+ extend: {
105
+ backgroundImage: {
106
+ 'image': "url('image.svg')"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ The inline version also works:
114
+
115
+ ```html
116
+ <section class="bg-[url('image.svg')]">Has the image as it's background</section>
117
+ ```
96
118
 
97
119
  ## License
98
120
 
@@ -2,9 +2,10 @@ const defaultTheme = require('tailwindcss/defaultTheme')
2
2
 
3
3
  module.exports = {
4
4
  content: [
5
+ './public/*.html',
5
6
  './app/helpers/**/*.rb',
6
7
  './app/javascript/**/*.js',
7
- './app/views/**/*'
8
+ './app/views/**/*.{erb,haml,html,slim}'
8
9
  ],
9
10
  theme: {
10
11
  extend: {
@@ -7,8 +7,10 @@ if APPLICATION_LAYOUT_PATH.exist?
7
7
  <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
8
8
  ERB
9
9
 
10
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, %( <main class="container mx-auto mt-28 px-5 flex">\n ), before: CENTERING_CONTAINER_INSERTION_POINT
11
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n </main>), after: CENTERING_CONTAINER_INSERTION_POINT
10
+ if File.open(APPLICATION_LAYOUT_PATH).read =~ /<body>\n\s*<%= yield %>\n\s*<\/body>/
11
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, %( <main class="container mx-auto mt-28 px-5 flex">\n ), before: CENTERING_CONTAINER_INSERTION_POINT
12
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n </main>), after: CENTERING_CONTAINER_INSERTION_POINT
13
+ end
12
14
  else
13
15
  say "Default application.html.erb is missing!", :red
14
16
  say %( Add <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
@@ -1,12 +1,13 @@
1
1
  module Tailwindcss
2
2
  # constants describing the upstream tailwindcss project
3
3
  module Upstream
4
- VERSION = "v3.0.22"
4
+ VERSION = "v3.1.3"
5
5
 
6
6
  # rubygems platform name => upstream release filename
7
7
  NATIVE_PLATFORMS = {
8
8
  "arm64-darwin" => "tailwindcss-macos-arm64",
9
9
  "x64-mingw32" => "tailwindcss-windows-x64.exe",
10
+ "x64-mingw-ucrt" => "tailwindcss-windows-x64.exe",
10
11
  "x86_64-darwin" => "tailwindcss-macos-x64",
11
12
  "x86_64-linux" => "tailwindcss-linux-x64",
12
13
  "aarch64-linux" => "tailwindcss-linux-arm64",
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "2.0.6"
2
+ VERSION = "2.0.9"
3
3
  end
data/lib/tasks/build.rake CHANGED
@@ -1,4 +1,4 @@
1
- TAILWIND_COMPILE_COMMAND = "#{Pathname.new(__dir__).to_s}/../../exe/tailwindcss -i #{Rails.root.join("app/assets/stylesheets/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds/tailwind.css")} -c #{Rails.root.join("config/tailwind.config.js")} --minify"
1
+ TAILWIND_COMPILE_COMMAND = "#{RbConfig.ruby} #{Pathname.new(__dir__).to_s}/../../exe/tailwindcss -i '#{Rails.root.join("app/assets/stylesheets/application.tailwind.css")}' -o '#{Rails.root.join("app/assets/builds/tailwind.css")}' -c '#{Rails.root.join("config/tailwind.config.js")}' --minify"
2
2
 
3
3
  namespace :tailwindcss do
4
4
  desc "Build your Tailwind CSS"
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.0.6
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-19 00:00:00.000000000 Z
11
+ date: 2022-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -51,7 +51,6 @@ files:
51
51
  - app/assets/fonts/Inter-roman.symbols.var.woff2
52
52
  - app/assets/fonts/Inter-roman.vietnamese.var.woff2
53
53
  - app/assets/stylesheets/inter-font.css
54
- - app/assets/stylesheets/tailwind.css
55
54
  - exe/tailwindcss
56
55
  - lib/generators/tailwindcss/controller/controller_generator.rb
57
56
  - lib/generators/tailwindcss/controller/templates/view.html.erb.tt
@@ -98,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
97
  - !ruby/object:Gem::Version
99
98
  version: '0'
100
99
  requirements: []
101
- rubygems_version: 3.2.32
100
+ rubygems_version: 3.3.14
102
101
  signing_key:
103
102
  specification_version: 4
104
103
  summary: Integrate Tailwind CSS with the asset pipeline in Rails.