tailwindcss-rails-webpacker 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/install/stylesheets/tailwind.config.js +19 -0
- data/lib/install/tailwindcss.rb +0 -1
- data/lib/tailwindcss/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b194df1be2279bca5ff3bfc82ed7b9c6c391a53f52b8ff0c1f439f0c139b9529
|
4
|
+
data.tar.gz: 59314057129220441d9e2dc37d28e1dc8822ebfba228c36ee98c14045450d686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbf5fff36f7c7076ffe7ae97e343b8c106cdaf6e5f02edc6126899bcf5767beeb0d67cba665c58fa0241aaf78bf68adfb37d168072b5749ff1029ca902eb2091
|
7
|
+
data.tar.gz: 40c89d7a27b438c2311cc0ce504229c8bb7a5a55954fb269e9ba3476d93938821d0cd19836223978bc1b8e4a71c96ed00926b62b844d3536035d51c7b650d0e2
|
data/README.md
CHANGED
@@ -12,6 +12,11 @@ This is extraction originally created inside the [tailwindcss-rails](https://git
|
|
12
12
|
1. Run `./bin/bundle add tailwindcss-rails-webpacker`
|
13
13
|
2. Run `./bin/rails tailwindcss:install`
|
14
14
|
|
15
|
+
## Purging in production
|
16
|
+
|
17
|
+
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.
|
18
|
+
|
19
|
+
This gem will automatically purge those unused classes in production.
|
15
20
|
|
16
21
|
## License
|
17
22
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module.exports = {
|
2
|
+
// Purge unused TailwindCSS styles
|
3
|
+
purge: {
|
4
|
+
enabled: ["production"].includes(process.env.NODE_ENV),
|
5
|
+
content: [
|
6
|
+
'./**/*.html.erb',
|
7
|
+
'./app/helpers/**/*.rb',
|
8
|
+
'./app/javascript/**/*.js',
|
9
|
+
],
|
10
|
+
},
|
11
|
+
darkMode: 'media', // or 'media' or 'class'
|
12
|
+
theme: {
|
13
|
+
extend: {},
|
14
|
+
},
|
15
|
+
variants: {
|
16
|
+
extend: {},
|
17
|
+
},
|
18
|
+
plugins: [],
|
19
|
+
}
|
data/lib/install/tailwindcss.rb
CHANGED
@@ -7,7 +7,6 @@ insert_into_file "#{Webpacker.config.source_entry_path}/application.js", "\nimpo
|
|
7
7
|
|
8
8
|
say "Configuring Tailwind CSS"
|
9
9
|
directory Pathname.new(__dir__).join("stylesheets"), Webpacker.config.source_path.join("stylesheets")
|
10
|
-
Dir.chdir(WEBPACK_STYLESHEETS_PATH) { run "npx tailwindcss init" }
|
11
10
|
|
12
11
|
insert_into_file "postcss.config.js", "require('tailwindcss')(\"./app/javascript/stylesheets/tailwind.config.js\"),\n ",
|
13
12
|
before: "require('postcss-import')"
|
data/lib/tailwindcss/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailwindcss-rails-webpacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dino Maric
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- README.md
|
37
37
|
- Rakefile
|
38
38
|
- lib/install/stylesheets/application.scss
|
39
|
+
- lib/install/stylesheets/tailwind.config.js
|
39
40
|
- lib/install/tailwindcss.rb
|
40
41
|
- lib/tailwindcss-rails-webpacker.rb
|
41
42
|
- lib/tailwindcss/engine.rb
|