tailwindcss-rails 0.3.3 → 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: 9a23aa96ec3c3b061d372150421858f794226f56ab7acadd4db92e949757ab16
4
- data.tar.gz: '0219635fa13a0a7abc84ec4897260cfeb4f207b46a02accd72424f277dbb0027'
3
+ metadata.gz: 034611e8ea49f35f8fb1f8c04e2a838011cf60f0a3ed532e583f8557b680f505
4
+ data.tar.gz: 0ec0ffa66dbd906af1021d53e533f448949d48f605505ace7ad04c6d4fa3d557
5
5
  SHA512:
6
- metadata.gz: 44d99ac7a29ed5ba163b52c5a9b9f835c71d5ee73826a6462133c8966d50ee219a826a4078912b092e1a0c4b5931744029cf97a3132c3e3725e20cb8816710a4
7
- data.tar.gz: 6755c08c948f909bf39f6bcf25d6ee48408e75e0e8d7ed18360043c8791dedc9fbdcfa52e6d980b66518a38258dcce20c0d9d32a8fb8627728ada2c583e5a8b6
6
+ metadata.gz: bfe791a46dfad464601c97c582dffcc415aae9525602bf892f6fafeb6aca3ba1f799161d5967958f0b3ad03201ca0537978f75add6afb64435cdb79372056d1f
7
+ data.tar.gz: 67bca0ab9ccaab58eecbc021175b79dfdab7df5bad4a8fbde909fc957c85516521260b6a3252fbfe7d16ab3bc99d12e7bfb018a851165bb82d9c5a8412c40627
data/README.md CHANGED
@@ -2,32 +2,28 @@
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
- Tailwind CSS for Rails works with both the asset pipeline and 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
6
 
7
- When use with the asset pipeline, 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 3mb+ Tailwind stylesheet is loaded. In both cases, Tailwind CSS is configured for dark mode, forms, aspect-ratio, typography, and the Inter font. If you need more configuration than that, you'll need to use it with Webpacker.
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.
8
8
 
9
- When used with Webpacker, Tailwind CSS is installed as a postCSS processor. Refer to the [TailwindCSS documentation](https://tailwindcss.com/docs/installation#customizing-your-configuration) to customize your tailwind.config.js file.
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.
10
10
 
11
11
 
12
12
  ## Installation
13
13
 
14
14
  1. Run `./bin/bundle add tailwindcss-rails`
15
- 2. Run `./bin/rails tailwindcss:install` (on a fresh Rails application)
15
+ 2. Run `./bin/rails tailwindcss:install`
16
16
 
17
- When run on an app using the just the asset pipeline, the last step adds the purger compressor to `config/environments/production.rb`. This ensures that when `assets:precompile` is called during deployment that the unused class names are not included in the tailwind output css used by the app. It also adds a `stylesheet_link_tag "tailwind"` and `stylesheet_link_tag "inter-font"` to your `app/views/application.html.erb` file.
17
+ The last step adds the purger compressor to `config/environments/production.rb`. This ensures that when `assets:precompile` is called during deployment that the unused class names are not included in the tailwind output css used by the app. It also adds a `stylesheet_link_tag "tailwind"` and `stylesheet_link_tag "inter-font"` to your `app/views/layouts/application.html.erb` file.
18
18
 
19
19
  You can do these things yourself, if you've changed the default setup.
20
20
 
21
- Note: You should ensure to delete `app/assets/stylesheets/scaffolds.scss` that Rails adds after running a scaffold command, if you had run this generator before installing Tailwind CSS for Rails. This stylesheet will interfere with Tailwind's reset of base styles. This gem will turn off stylesheet generation for all future scaffold runs.
22
-
23
- When run on an app using Webpacker, the last step adds the npm dependencies for Tailwind CSS, configures postCSS, and generates a app/javascript/stylesheets/application.scss file as the default for using Tailwind.
24
-
25
21
 
26
22
  ## Purging in production
27
23
 
28
- The Tailwind CSS framework starts out as a massive file, which gives you all the combinations of utility classes for development, but you wouldn't want to ship all those unused classes in production. So this gem includes a Sprockets compressor that purges the tailwind file from all those unused classes when Tailwind CSS for Rails is used with the asset pipeline.
24
+ The Tailwind CSS framework starts out as a massive file, which gives you all the combinations of utility classes for development, but you wouldn't want to ship all those unused classes in production. So the Sprockets compressor included in this gem is used to purge the tailwind file from all those unused classes for production.
29
25
 
30
- This compressor is currently not compatible with the default Sprockets cache system due to the fact its output depends on files outside of Sprockets (all the files observed for utility class name usage), so this cache is disabled in production. If you need to disable it in other deployed environments, add the following to that environment configuration file:
26
+ Note: This compressor is currently not compatible with the default Sprockets cache system due to the fact its output depends on files outside of Sprockets (all the files observed for utility class name usage), so this cache is disabled in production. If you need to disable it in other deployed environments, add the following to that environment configuration file:
31
27
 
32
28
  ```ruby
33
29
  Rails.application.config.assets.configure do |env|
@@ -51,8 +47,19 @@ By default, the CSS purger will only operate on the tailwind css file included w
51
47
  ```
52
48
 
53
49
 
50
+ ## Tailwind versions
51
+
52
+ The Tailwind CSS main file that's being used before purging consists of these versions:
53
+
54
+ * @tailwindcss/aspect-ratio 0.2.1
55
+ * @tailwindcss/forms 0.3.3
56
+ * @tailwindcss/typography 0.4.1
57
+ * autoprefixer 10.3.1
58
+ * tailwindcss 2.2.15
59
+
60
+
54
61
  ## License
55
62
 
56
63
  Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
57
64
  Tailwind CSS is released under the [MIT License](https://opensource.org/licenses/MIT).
58
- The Inter font is released under the [SIL Open Font License, Version 1.1](https://github.com/rsms/inter/blob/master/LICENSE.txt).
65
+ The Inter font is released under the [SIL Open Font License, Version 1.1](https://github.com/rsms/inter/blob/master/LICENSE.txt).
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