tailwindcss-rails-plugable 2.0.12.pre.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +123 -0
- data/Rakefile +14 -0
- data/app/assets/fonts/Inter-italic.alternates.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.cyrillic.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.extra.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.greek.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.latin-ext.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.latin.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.symbols.var.woff2 +0 -0
- data/app/assets/fonts/Inter-italic.vietnamese.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.alternates.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.cyrillic.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.extra.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.greek.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.latin-ext.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.latin.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.symbols.var.woff2 +0 -0
- data/app/assets/fonts/Inter-roman.vietnamese.var.woff2 +0 -0
- data/app/assets/stylesheets/inter-font.css +194 -0
- data/exe/tailwindcss +46 -0
- data/lib/generators/tailwindcss/controller/controller_generator.rb +9 -0
- data/lib/generators/tailwindcss/controller/templates/view.html.erb.tt +4 -0
- data/lib/generators/tailwindcss/mailer/mailer_generator.rb +9 -0
- data/lib/generators/tailwindcss/mailer/templates/view.html.erb.tt +5 -0
- data/lib/generators/tailwindcss/mailer/templates/view.text.erb.tt +3 -0
- data/lib/generators/tailwindcss/scaffold/scaffold_generator.rb +34 -0
- data/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt +43 -0
- data/lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt +8 -0
- data/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +14 -0
- data/lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt +7 -0
- data/lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt +22 -0
- data/lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt +15 -0
- data/lib/install/Procfile.dev +2 -0
- data/lib/install/application.tailwind.css +13 -0
- data/lib/install/dev +9 -0
- data/lib/install/tailwind.config.js +33 -0
- data/lib/install/tailwind.plugins.yml +4 -0
- data/lib/install/tailwindcss.rb +61 -0
- data/lib/tailwindcss/engine.rb +17 -0
- data/lib/tailwindcss/upstream.rb +16 -0
- data/lib/tailwindcss/version.rb +3 -0
- data/lib/tailwindcss-rails-plugable.rb +6 -0
- data/lib/tasks/build.rake +44 -0
- data/lib/tasks/clobber.rake +9 -0
- data/lib/tasks/install.rake +6 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c1c92b90b1776d9b02ff767b44605b3d9cae890221944b0fd2ffbf56b0ff1be2
|
4
|
+
data.tar.gz: e6e38bc0b69590f092e02ed234b138cb69b1bd0f103ff087b8bd566387993e40
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0332dbc821c472ce76dccd087fa2804ee2ea90558ee3d726a7b62fad3aae5d455e9cd17a182850162b37ae5d706fde18dabc4d886198d97e27efccb84556f484
|
7
|
+
data.tar.gz: 032bc3f6c70dd272cca824f9f0cb6c78238b0a5a788d0dc542e5cc6a6ad5de14154174348a542eda96c6e46d70e8176c2a5dd07658e2ec79b0810805efc58325
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2020 David Heinemeier Hansson
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
# Tailwind CSS for Rails
|
2
|
+
|
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
|
+
|
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
|
+
|
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
|
+
|
9
|
+
The installer will create your Tailwind input file in `app/assets/stylesheets/application.tailwind.css`. This is where you import the plugins you want to use, and where you can setup your custom `@apply` rules. When you run `rails tailwindcss:build`, this input file will be used to generate the output in `app/assets/builds/tailwind.css`. That's the output CSS that you'll include in your app (the installer automatically configures this, alongside the Inter font as well).
|
10
|
+
|
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
|
+
|
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
|
+
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
With Rails 7 you can generate a new application preconfigured with Tailwind by using `--css tailwind`. If you're adding Tailwind later, you need to:
|
19
|
+
|
20
|
+
1. Run `./bin/bundle add tailwindcss-rails`
|
21
|
+
2. Run `./bin/rails tailwindcss:install`
|
22
|
+
|
23
|
+
|
24
|
+
## Building in production
|
25
|
+
|
26
|
+
The `tailwindcss:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Tailwind output will be generated.
|
27
|
+
|
28
|
+
## Building for testing
|
29
|
+
|
30
|
+
The `tailwindcss:build` is automatically attached to `test:prepare`, which runs before Rails tests. (Note that this currently only applies to rails `test:*` tasks (like `test:all` or `test:controllers`), not "rails test", as that doesn't load `test:prepare`).
|
31
|
+
|
32
|
+
## Conflict with sassc-rails
|
33
|
+
|
34
|
+
Tailwind uses modern CSS features that are not recognized by the `sassc-rails` extension that was included by default in the Gemfile for Rails 6. In order to avoid any errors like `SassC::SyntaxError`, you must remove that gem from your Gemfile.
|
35
|
+
|
36
|
+
## Class names must be spelled out
|
37
|
+
|
38
|
+
For Tailwind to work, your class names need to be spelled out. They can't be programmatically composed. So no "text-gray-#{grade}", only "text-gray-500".
|
39
|
+
|
40
|
+
## Troubleshooting
|
41
|
+
|
42
|
+
Some common problems experienced by users ...
|
43
|
+
|
44
|
+
### ERROR: Cannot find the tailwindcss executable for <supported platform>
|
45
|
+
|
46
|
+
Some users are reporting this error even when running on one of the supported native platforms:
|
47
|
+
|
48
|
+
- arm64-darwin
|
49
|
+
- x64-mingw32
|
50
|
+
- x64-mingw-ucrt
|
51
|
+
- x86_64-darwin
|
52
|
+
- x86_64-linux
|
53
|
+
- aarch64-linux
|
54
|
+
|
55
|
+
#### Check Bundler PLATFORMS
|
56
|
+
|
57
|
+
A possible cause of this is that Bundler has not been told to include native gems for your current platform. Please check your `Gemfile.lock` file to see whether your native platform is included in the `PLATFORMS` section. If necessary, run:
|
58
|
+
|
59
|
+
``` sh
|
60
|
+
bundle lock --add-platform <platform-name>
|
61
|
+
```
|
62
|
+
|
63
|
+
and re-bundle.
|
64
|
+
|
65
|
+
|
66
|
+
#### Check BUNDLE_FORCE_RUBY_PLATFORM
|
67
|
+
|
68
|
+
Another common cause of this is that bundler is configured to always use the "ruby" platform via the
|
69
|
+
`BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:
|
70
|
+
|
71
|
+
``` sh
|
72
|
+
bundle config unset force_ruby_platform
|
73
|
+
# or
|
74
|
+
bundle config set --local force_ruby_platform false
|
75
|
+
```
|
76
|
+
|
77
|
+
and re-bundle.
|
78
|
+
|
79
|
+
See https://bundler.io/man/bundle-config.1.html for more information.
|
80
|
+
|
81
|
+
|
82
|
+
### "No such file or directory" running on Alpine (musl)
|
83
|
+
|
84
|
+
When running `tailwindcss` on an Alpine system, some users report a "No such file or directory" error message.
|
85
|
+
|
86
|
+
|
87
|
+
#### Install gnu libc compatibility
|
88
|
+
|
89
|
+
The cause of this is the upstream `tailwindcss` binary executables being built on a gnu libc system, making them incompatible with standard musl libc systems.
|
90
|
+
|
91
|
+
A fix for this has been proposed upstream at https://github.com/tailwindlabs/tailwindcss/discussions/6785, but in the meantime a workaround is to install compatibility libraries:
|
92
|
+
|
93
|
+
``` sh
|
94
|
+
apk add build-base gcompat
|
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
|
+
```
|
118
|
+
|
119
|
+
## License
|
120
|
+
|
121
|
+
Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
|
122
|
+
Tailwind CSS is released under the [MIT License](https://opensource.org/licenses/MIT).
|
123
|
+
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
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,194 @@
|
|
1
|
+
/*
|
2
|
+
*= link_directory ../fonts
|
3
|
+
*/
|
4
|
+
|
5
|
+
@font-face {
|
6
|
+
font-family: 'Inter var';
|
7
|
+
font-style: italic;
|
8
|
+
font-weight: 100 900;
|
9
|
+
font-display: swap;
|
10
|
+
src: url('Inter-italic.extra.var.woff2') format('woff2');
|
11
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
12
|
+
font-named-instance: 'Italic';
|
13
|
+
}
|
14
|
+
/* alternates */
|
15
|
+
@font-face {
|
16
|
+
font-family: 'Inter var';
|
17
|
+
font-style: italic;
|
18
|
+
font-weight: 100 900;
|
19
|
+
font-display: swap;
|
20
|
+
src: url('Inter-italic.alternates.var.woff2') format('woff2');
|
21
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
22
|
+
font-named-instance: 'Italic';
|
23
|
+
}
|
24
|
+
/* symbols */
|
25
|
+
@font-face {
|
26
|
+
font-family: 'Inter var';
|
27
|
+
font-style: italic;
|
28
|
+
font-weight: 100 900;
|
29
|
+
font-display: swap;
|
30
|
+
src: url('Inter-italic.symbols.var.woff2') format('woff2');
|
31
|
+
unicode-range: U+20DD-20DF,U+2190-219A,U+21A9-21AB,U+21B0-21B2,U+21B3-21B6,U+21BA-21BC,U+21D0,U+21D2,U+21D4,U+21DE-21E0,U+21E4-21E6,U+21E7,U+21EA,U+2303,U+2305,U+2318,U+2325-2328,U+232B,U+2380,U+2387,U+238B,U+23CE-23D0,U+2460-2469,U+24B6-24D0,U+24EA,U+25A0-25A3,U+25B2-25B4,U+25B6-25B8,U+25BA-25BE,U+25C0-25C2,U+25C4-25C8,U+25CB,U+25CF,U+25EF,U+2600,U+2605-2607,U+263C,U+2661,U+2665,U+26A0,U+2713,U+2717,U+2756,U+2764,U+2780-2789,U+27F5-27FB,U+2B06,U+2B12-2B14,U+2B1C,U+E000,U+E12B-E164,U+1F130-1F14A,U+1F850,U+1F852;
|
32
|
+
font-named-instance: 'Italic';
|
33
|
+
}
|
34
|
+
|
35
|
+
/* extra */
|
36
|
+
@font-face {
|
37
|
+
font-family: 'Inter var';
|
38
|
+
font-style: italic;
|
39
|
+
font-weight: 100 900;
|
40
|
+
font-display: swap;
|
41
|
+
src: url('Inter-italic.extra.var.woff2') format('woff2');
|
42
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
43
|
+
font-named-instance: 'Italic';
|
44
|
+
}
|
45
|
+
/* alternates */
|
46
|
+
@font-face {
|
47
|
+
font-family: 'Inter var';
|
48
|
+
font-style: italic;
|
49
|
+
font-weight: 100 900;
|
50
|
+
font-display: swap;
|
51
|
+
src: url('Inter-italic.alternates.var.woff2') format('woff2');
|
52
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
53
|
+
font-named-instance: 'Italic';
|
54
|
+
}
|
55
|
+
/* symbols */
|
56
|
+
@font-face {
|
57
|
+
font-family: 'Inter var';
|
58
|
+
font-style: italic;
|
59
|
+
font-weight: 100 900;
|
60
|
+
font-display: swap;
|
61
|
+
src: url('Inter-italic.symbols.var.woff2') format('woff2');
|
62
|
+
unicode-range: U+20DD-20DF,U+2190-219A,U+21A9-21AB,U+21B0-21B2,U+21B3-21B6,U+21BA-21BC,U+21D0,U+21D2,U+21D4,U+21DE-21E0,U+21E4-21E6,U+21E7,U+21EA,U+2303,U+2305,U+2318,U+2325-2328,U+232B,U+2380,U+2387,U+238B,U+23CE-23D0,U+2460-2469,U+24B6-24D0,U+24EA,U+25A0-25A3,U+25B2-25B4,U+25B6-25B8,U+25BA-25BE,U+25C0-25C2,U+25C4-25C8,U+25CB,U+25CF,U+25EF,U+2600,U+2605-2607,U+263C,U+2661,U+2665,U+26A0,U+2713,U+2717,U+2756,U+2764,U+2780-2789,U+27F5-27FB,U+2B06,U+2B12-2B14,U+2B1C,U+E000,U+E12B-E164,U+1F130-1F14A,U+1F850,U+1F852;
|
63
|
+
font-named-instance: 'Italic';
|
64
|
+
}
|
65
|
+
/* cyrillic */
|
66
|
+
@font-face {
|
67
|
+
font-family: 'Inter var';
|
68
|
+
font-style: italic;
|
69
|
+
font-weight: 100 900;
|
70
|
+
font-display: swap;
|
71
|
+
src: url('Inter-italic.cyrillic.var.woff2') format('woff2');
|
72
|
+
unicode-range: U+0400-049E,U+04A0-0500,U+052F,U+20B4,U+2116,U+2DFF,U+A69F;
|
73
|
+
font-named-instance: 'Italic';
|
74
|
+
}
|
75
|
+
/* greek */
|
76
|
+
@font-face {
|
77
|
+
font-family: 'Inter var';
|
78
|
+
font-style: italic;
|
79
|
+
font-weight: 100 900;
|
80
|
+
font-display: swap;
|
81
|
+
src: url('Inter-italic.greek.var.woff2') format('woff2');
|
82
|
+
unicode-range: U+0370-0378,U+037A-0380,U+0384-038B,U+038C,U+038E-03A2,U+03A3-03E2,U+03F0-0400,U+1F00-1F16,U+1F18-1F1E,U+1F20-1F46,U+1F48-1F4E,U+1F50-1F58,U+1F59,U+1F5B,U+1F5D,U+1F5F-1F7E,U+1F80-1FB5,U+1FB6-1FC5,U+1FC6-1FD4,U+1FD6-1FDC,U+1FDD-1FF0,U+1FF2-1FF5,U+1FF6-1FFF;
|
83
|
+
font-named-instance: 'Italic';
|
84
|
+
}
|
85
|
+
/* vietnamese */
|
86
|
+
@font-face {
|
87
|
+
font-family: 'Inter var';
|
88
|
+
font-style: italic;
|
89
|
+
font-weight: 100 900;
|
90
|
+
font-display: swap;
|
91
|
+
src: url('Inter-italic.vietnamese.var.woff2') format('woff2');
|
92
|
+
unicode-range: U+0102-0104,U+0110-0112,U+0128-012A,U+0168-016A,U+01A0-01A2,U+01AF-01B1,U+1EA0-1EFA,U+20AB;
|
93
|
+
font-named-instance: 'Italic';
|
94
|
+
}
|
95
|
+
/* latin-ext */
|
96
|
+
@font-face {
|
97
|
+
font-family: 'Inter var';
|
98
|
+
font-style: italic;
|
99
|
+
font-weight: 100 900;
|
100
|
+
font-display: swap;
|
101
|
+
src: url('Inter-italic.latin-ext.var.woff2') format('woff2');
|
102
|
+
unicode-range: U+0100-0149,U+014A-01C4,U+01C5-0250,U+0259,U+1E00-1F00,U+2020,U+20A0-20AC,U+20AD-20C0,U+2113,U+2C7C,U+2C7F,U+A7FF;
|
103
|
+
font-named-instance: 'Italic';
|
104
|
+
}
|
105
|
+
/* latin */
|
106
|
+
@font-face {
|
107
|
+
font-family: 'Inter var';
|
108
|
+
font-style: italic;
|
109
|
+
font-weight: 100 900;
|
110
|
+
font-display: swap;
|
111
|
+
src: url('Inter-italic.latin.var.woff2') format('woff2');
|
112
|
+
unicode-range: U+0000-007F,U+00A0-0100,U+0131,U+0152-0154,U+02BB-02BD,U+02C6,U+02DA,U+02DC,U+2000-200C,U+2010-2028,U+202F-2060,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+FEFF;
|
113
|
+
font-named-instance: 'Italic';
|
114
|
+
}
|
115
|
+
/* extra */
|
116
|
+
@font-face {
|
117
|
+
font-family: 'Inter var';
|
118
|
+
font-style: normal;
|
119
|
+
font-weight: 100 900;
|
120
|
+
font-display: swap;
|
121
|
+
src: url('Inter-roman.extra.var.woff2') format('woff2');
|
122
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
123
|
+
font-named-instance: 'Regular';
|
124
|
+
}
|
125
|
+
/* alternates */
|
126
|
+
@font-face {
|
127
|
+
font-family: 'Inter var';
|
128
|
+
font-style: normal;
|
129
|
+
font-weight: 100 900;
|
130
|
+
font-display: swap;
|
131
|
+
src: url('Inter-roman.alternates.var.woff2') format('woff2');
|
132
|
+
unicode-range: U+E000,U+E002-E081,U+E093-E097,U+E0A5-E0E7,U+E0F3-E11D,U+E11E-E165,U+EE01,U+F6C3;
|
133
|
+
font-named-instance: 'Regular';
|
134
|
+
}
|
135
|
+
/* symbols */
|
136
|
+
@font-face {
|
137
|
+
font-family: 'Inter var';
|
138
|
+
font-style: normal;
|
139
|
+
font-weight: 100 900;
|
140
|
+
font-display: swap;
|
141
|
+
src: url('Inter-roman.symbols.var.woff2') format('woff2');
|
142
|
+
unicode-range: U+20DD-20DF,U+2190-219A,U+21A9-21AB,U+21B0-21B2,U+21B3-21B6,U+21BA-21BC,U+21D0,U+21D2,U+21D4,U+21DE-21E0,U+21E4-21E6,U+21E7,U+21EA,U+2303,U+2305,U+2318,U+2325-2328,U+232B,U+2380,U+2387,U+238B,U+23CE-23D0,U+2460-2469,U+24B6-24D0,U+24EA,U+25A0-25A3,U+25B2-25B4,U+25B6-25B8,U+25BA-25BE,U+25C0-25C2,U+25C4-25C8,U+25CB,U+25CF,U+25EF,U+2600,U+2605-2607,U+263C,U+2661,U+2665,U+26A0,U+2713,U+2717,U+2756,U+2764,U+2780-2789,U+27F5-27FB,U+2B06,U+2B12-2B14,U+2B1C,U+E000,U+E12B-E164,U+1F130-1F14A,U+1F850,U+1F852;
|
143
|
+
font-named-instance: 'Regular';
|
144
|
+
}
|
145
|
+
/* cyrillic */
|
146
|
+
@font-face {
|
147
|
+
font-family: 'Inter var';
|
148
|
+
font-style: normal;
|
149
|
+
font-weight: 100 900;
|
150
|
+
font-display: swap;
|
151
|
+
src: url('Inter-roman.cyrillic.var.woff2') format('woff2');
|
152
|
+
unicode-range: U+0400-049E,U+04A0-0500,U+052F,U+20B4,U+2116,U+2DFF,U+A69F;
|
153
|
+
font-named-instance: 'Regular';
|
154
|
+
}
|
155
|
+
/* greek */
|
156
|
+
@font-face {
|
157
|
+
font-family: 'Inter var';
|
158
|
+
font-style: normal;
|
159
|
+
font-weight: 100 900;
|
160
|
+
font-display: swap;
|
161
|
+
src: url('Inter-roman.greek.var.woff2') format('woff2');
|
162
|
+
unicode-range: U+0370-0378,U+037A-0380,U+0384-038B,U+038C,U+038E-03A2,U+03A3-03E2,U+03F0-0400,U+1F00-1F16,U+1F18-1F1E,U+1F20-1F46,U+1F48-1F4E,U+1F50-1F58,U+1F59,U+1F5B,U+1F5D,U+1F5F-1F7E,U+1F80-1FB5,U+1FB6-1FC5,U+1FC6-1FD4,U+1FD6-1FDC,U+1FDD-1FF0,U+1FF2-1FF5,U+1FF6-1FFF;
|
163
|
+
font-named-instance: 'Regular';
|
164
|
+
}
|
165
|
+
/* vietnamese */
|
166
|
+
@font-face {
|
167
|
+
font-family: 'Inter var';
|
168
|
+
font-style: normal;
|
169
|
+
font-weight: 100 900;
|
170
|
+
font-display: swap;
|
171
|
+
src: url('Inter-roman.vietnamese.var.woff2') format('woff2');
|
172
|
+
unicode-range: U+0102-0104,U+0110-0112,U+0128-012A,U+0168-016A,U+01A0-01A2,U+01AF-01B1,U+1EA0-1EFA,U+20AB;
|
173
|
+
font-named-instance: 'Regular';
|
174
|
+
}
|
175
|
+
/* latin-ext */
|
176
|
+
@font-face {
|
177
|
+
font-family: 'Inter var';
|
178
|
+
font-style: normal;
|
179
|
+
font-weight: 100 900;
|
180
|
+
font-display: swap;
|
181
|
+
src: url('Inter-roman.latin-ext.var.woff2') format('woff2');
|
182
|
+
unicode-range: U+0100-0149,U+014A-01C4,U+01C5-0250,U+0259,U+1E00-1F00,U+2020,U+20A0-20AC,U+20AD-20C0,U+2113,U+2C7C,U+2C7F,U+A7FF;
|
183
|
+
font-named-instance: 'Regular';
|
184
|
+
}
|
185
|
+
/* latin */
|
186
|
+
@font-face {
|
187
|
+
font-family: 'Inter var';
|
188
|
+
font-style: normal;
|
189
|
+
font-weight: 100 900;
|
190
|
+
font-display: swap;
|
191
|
+
src: url('Inter-roman.latin.var.woff2') format('woff2');
|
192
|
+
unicode-range: U+0000-007F,U+00A0-0100,U+0131,U+0152-0154,U+02BB-02BD,U+02C6,U+02DA,U+02DC,U+2000-200C,U+2010-2028,U+202F-2060,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+FEFF;
|
193
|
+
font-named-instance: 'Regular';
|
194
|
+
}
|
data/exe/tailwindcss
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# because rubygems shims assume a gem's executables are Ruby
|
3
|
+
|
4
|
+
require "shellwords"
|
5
|
+
require "tailwindcss/upstream"
|
6
|
+
|
7
|
+
supported_platforms = Tailwindcss::Upstream::NATIVE_PLATFORMS.keys
|
8
|
+
platform = [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
9
|
+
|
10
|
+
if supported_platforms.none? { |supported_platform| Gem::Platform.match(supported_platform) }
|
11
|
+
STDERR.puts(<<~ERRMSG)
|
12
|
+
ERROR: tailwindcss-rails does not support the #{platform} platform
|
13
|
+
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
|
14
|
+
ERRMSG
|
15
|
+
exit 1
|
16
|
+
end
|
17
|
+
|
18
|
+
exe_path = Dir.glob(File.join(__dir__, "*", "tailwindcss")).find do |f|
|
19
|
+
Gem::Platform.match(File.basename(File.dirname(f)))
|
20
|
+
end
|
21
|
+
if exe_path.nil?
|
22
|
+
STDERR.puts(<<~ERRMSG)
|
23
|
+
ERROR: Cannot find the tailwindcss executable for #{platform} in #{__dir__}
|
24
|
+
If you're using bundler, please make sure you're on the latest bundler version:
|
25
|
+
|
26
|
+
gem install bundler
|
27
|
+
bundle update --bundler
|
28
|
+
|
29
|
+
Then make sure your lock file includes this platform by running:
|
30
|
+
|
31
|
+
bundle lock --add-platform #{platform}
|
32
|
+
bundle install
|
33
|
+
|
34
|
+
See `bundle lock --help` output for details.
|
35
|
+
|
36
|
+
If you're still seeing this message after taking those steps, try running
|
37
|
+
`bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
|
38
|
+
https://github.com/rails/tailwindcss-rails#check-bundle_force_ruby_platform
|
39
|
+
for more details.
|
40
|
+
ERRMSG
|
41
|
+
exit 1
|
42
|
+
end
|
43
|
+
|
44
|
+
command = Shellwords.join([exe_path, ARGV].flatten)
|
45
|
+
puts "+ #{command}"
|
46
|
+
exec(command)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rails/generators/erb/scaffold/scaffold_generator'
|
2
|
+
require "rails/generators/resource_helpers"
|
3
|
+
|
4
|
+
module Tailwindcss
|
5
|
+
module Generators
|
6
|
+
class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
7
|
+
include Rails::Generators::ResourceHelpers
|
8
|
+
|
9
|
+
source_root File.expand_path("../templates", __FILE__)
|
10
|
+
|
11
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
12
|
+
|
13
|
+
def create_root_folder
|
14
|
+
empty_directory File.join("app/views", controller_file_path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def copy_view_files
|
18
|
+
available_views.each do |view|
|
19
|
+
formats.each do |format|
|
20
|
+
filename = filename_with_extensions(view, format)
|
21
|
+
template filename, File.join("app/views", controller_file_path, filename)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
template "partial.html.erb", File.join("app/views", controller_file_path, "_#{singular_table_name}.html.erb")
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def available_views
|
30
|
+
%w(index edit show new _form)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<%%= form_with(model: <%= model_resource_name %>, class: "contents") do |form| %>
|
2
|
+
<%% if <%= singular_table_name %>.errors.any? %>
|
3
|
+
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3">
|
4
|
+
<h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<%% <%= singular_table_name %>.errors.each do |error| %>
|
8
|
+
<li><%%= error.full_message %></li>
|
9
|
+
<%% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<%% end %>
|
13
|
+
|
14
|
+
<% attributes.each do |attribute| -%>
|
15
|
+
<div class="my-5">
|
16
|
+
<% if attribute.password_digest? -%>
|
17
|
+
<%%= form.label :password %>
|
18
|
+
<%%= form.password_field :password %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="my-5">
|
22
|
+
<%%= form.label :password_confirmation %>
|
23
|
+
<%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
|
24
|
+
<% elsif attribute.attachments? -%>
|
25
|
+
<%%= form.label :<%= attribute.column_name %> %>
|
26
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
|
27
|
+
<% else -%>
|
28
|
+
<%%= form.label :<%= attribute.column_name %> %>
|
29
|
+
<% if attribute.field_type == :text_area -%>
|
30
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
|
31
|
+
<% elsif attribute.field_type == :check_box -%>
|
32
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block mt-2 h-5 w-5" %>
|
33
|
+
<% else -%>
|
34
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
|
35
|
+
<% end -%>
|
36
|
+
<% end -%>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<% end -%>
|
40
|
+
<div class="inline">
|
41
|
+
<%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
|
42
|
+
</div>
|
43
|
+
<%% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="mx-auto md:w-2/3 w-full">
|
2
|
+
<h1 class="font-bold text-4xl">Editing <%= human_name.downcase %></h1>
|
3
|
+
|
4
|
+
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
5
|
+
|
6
|
+
<%%= link_to "Show this <%= human_name.downcase %>", @<%= singular_table_name %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
7
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
8
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="w-full">
|
2
|
+
<%% if notice.present? %>
|
3
|
+
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%%= notice %></p>
|
4
|
+
<%% end %>
|
5
|
+
|
6
|
+
<div class="flex justify-between items-center">
|
7
|
+
<h1 class="font-bold text-4xl"><%= human_name.pluralize %></h1>
|
8
|
+
<%%= link_to 'New <%= human_name.downcase %>', new_<%= singular_route_name %>_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div id="<%= plural_table_name %>" class="min-w-full">
|
12
|
+
<%%= render @<%= plural_table_name %> %>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="mx-auto md:w-2/3 w-full">
|
2
|
+
<h1 class="font-bold text-4xl">New <%= human_name.downcase %></h1>
|
3
|
+
|
4
|
+
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
|
5
|
+
|
6
|
+
<%%= link_to 'Back to <%= human_name.pluralize.downcase %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
7
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div id="<%%= dom_id <%= singular_table_name %> %>">
|
2
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
|
+
<p class="my-5">
|
4
|
+
<strong class="block font-medium mb-1"><%= attribute.human_name %>:</strong>
|
5
|
+
<% if attribute.attachment? -%>
|
6
|
+
<%%= link_to <%= singular_table_name %>.<%= attribute.column_name %>.filename, <%= singular_table_name %>.<%= attribute.column_name %> if <%= singular_table_name %>.<%= attribute.column_name %>.attached? %>
|
7
|
+
<% elsif attribute.attachments? -%>
|
8
|
+
<%% <%= singular_table_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
|
9
|
+
<div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
|
10
|
+
<%% end %>
|
11
|
+
<% else -%>
|
12
|
+
<%%= <%= singular_table_name %>.<%= attribute.column_name %> %>
|
13
|
+
<% end -%>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<% end -%>
|
17
|
+
<%% if action_name != "show" %>
|
18
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= singular_table_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
19
|
+
<%%= link_to 'Edit this <%= human_name.downcase %>', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
|
20
|
+
<hr class="mt-6">
|
21
|
+
<%% end %>
|
22
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="mx-auto md:w-2/3 w-full flex">
|
2
|
+
<div class="mx-auto">
|
3
|
+
<%% if notice.present? %>
|
4
|
+
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%%= notice %></p>
|
5
|
+
<%% end %>
|
6
|
+
|
7
|
+
<%%= render @<%= singular_table_name %> %>
|
8
|
+
|
9
|
+
<%%= link_to 'Edit this <%= singular_table_name %>', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
10
|
+
<div class="inline-block ml-2">
|
11
|
+
<%%= button_to 'Destroy this <%= singular_table_name %>', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
|
12
|
+
</div>
|
13
|
+
<%%= link_to 'Back to <%= plural_table_name %>', <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
data/lib/install/dev
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
const defaultTheme = require('tailwindcss/defaultTheme')
|
2
|
+
const plugin = require('tailwindcss/plugin')
|
3
|
+
const path = require("path")
|
4
|
+
const fs = require("fs");
|
5
|
+
|
6
|
+
const usePlugin = (pluginName) => plugin(({ addUtilities, postcss }) => {
|
7
|
+
const pluginPath = path.join(__dirname, "../tmp/tailwindcss-plugin/", pluginName + ".css")
|
8
|
+
const css = fs.readFileSync(pluginPath, 'utf8')
|
9
|
+
addUtilities(postcss.parse(css).nodes)
|
10
|
+
})
|
11
|
+
|
12
|
+
|
13
|
+
module.exports = {
|
14
|
+
content: [
|
15
|
+
'./public/*.html',
|
16
|
+
'./app/helpers/**/*.rb',
|
17
|
+
'./app/javascript/**/*.js',
|
18
|
+
'./app/views/**/*.{erb,haml,html,slim}'
|
19
|
+
],
|
20
|
+
theme: {
|
21
|
+
extend: {
|
22
|
+
fontFamily: {
|
23
|
+
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
|
24
|
+
},
|
25
|
+
},
|
26
|
+
},
|
27
|
+
plugins: [
|
28
|
+
require('@tailwindcss/forms'),
|
29
|
+
require('@tailwindcss/aspect-ratio'),
|
30
|
+
require('@tailwindcss/typography'),
|
31
|
+
// usePlugin(pluginName) => plugin name is based on that defined in tailwind.plugins.yml
|
32
|
+
]
|
33
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
|
2
|
+
CENTERING_CONTAINER_INSERTION_POINT = /^\s*<%= yield %>/.freeze
|
3
|
+
|
4
|
+
if APPLICATION_LAYOUT_PATH.exist?
|
5
|
+
say "Add Tailwindcss include tags and container element in application layout"
|
6
|
+
insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4), before: /^\s*<%= stylesheet_link_tag/
|
7
|
+
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
8
|
+
ERB
|
9
|
+
|
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
|
14
|
+
else
|
15
|
+
say "Default application.html.erb is missing!", :red
|
16
|
+
say %( Add <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
|
17
|
+
end
|
18
|
+
|
19
|
+
say "Build into app/assets/builds"
|
20
|
+
empty_directory "app/assets/builds"
|
21
|
+
keep_file "app/assets/builds"
|
22
|
+
|
23
|
+
if (sprockets_manifest_path = Rails.root.join("app/assets/config/manifest.js")).exist?
|
24
|
+
append_to_file sprockets_manifest_path, %(//= link_tree ../builds\n)
|
25
|
+
end
|
26
|
+
|
27
|
+
if Rails.root.join(".gitignore").exist?
|
28
|
+
append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
|
29
|
+
end
|
30
|
+
|
31
|
+
unless Rails.root.join("config/tailwind.config.js").exist?
|
32
|
+
say "Add default config/tailwindcss.config.js"
|
33
|
+
copy_file "#{__dir__}/tailwind.config.js", "config/tailwind.config.js"
|
34
|
+
end
|
35
|
+
|
36
|
+
unless Rails.root.join("config/tailwind.plugins.yml").exist?
|
37
|
+
say "Add default config/tailwindcss.plugins.yml"
|
38
|
+
copy_file "#{__dir__}/tailwind.plugins.yml", "config/tailwind.plugins.yml"
|
39
|
+
end
|
40
|
+
|
41
|
+
unless Rails.root.join("app/assets/stylesheets/application.tailwind.css").exist?
|
42
|
+
say "Add default app/assets/stylesheets/application.tailwind.css"
|
43
|
+
copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/application.tailwind.css"
|
44
|
+
end
|
45
|
+
|
46
|
+
if Rails.root.join("Procfile.dev").exist?
|
47
|
+
append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n"
|
48
|
+
else
|
49
|
+
say "Add default Procfile.dev"
|
50
|
+
copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
|
51
|
+
|
52
|
+
say "Ensure foreman is installed"
|
53
|
+
run "gem install foreman"
|
54
|
+
end
|
55
|
+
|
56
|
+
say "Add bin/dev to start foreman"
|
57
|
+
copy_file "#{__dir__}/dev", "bin/dev"
|
58
|
+
chmod "bin/dev", 0755, verbose: false
|
59
|
+
|
60
|
+
say "Compile initial Tailwind build"
|
61
|
+
run "rails tailwindcss:build"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rails"
|
2
|
+
|
3
|
+
module Tailwindcss
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
initializer "tailwindcss.assets" do
|
6
|
+
Rails.application.config.assets.precompile += %w( inter-font.css )
|
7
|
+
end
|
8
|
+
|
9
|
+
initializer "tailwindcss.disable_generator_stylesheets" do
|
10
|
+
Rails.application.config.generators.stylesheets = false
|
11
|
+
end
|
12
|
+
|
13
|
+
config.app_generators do |g|
|
14
|
+
g.template_engine :tailwindcss
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Tailwindcss
|
2
|
+
# constants describing the upstream tailwindcss project
|
3
|
+
module Upstream
|
4
|
+
VERSION = "v3.1.3"
|
5
|
+
|
6
|
+
# rubygems platform name => upstream release filename
|
7
|
+
NATIVE_PLATFORMS = {
|
8
|
+
"arm64-darwin" => "tailwindcss-macos-arm64",
|
9
|
+
"x64-mingw32" => "tailwindcss-windows-x64.exe",
|
10
|
+
"x64-mingw-ucrt" => "tailwindcss-windows-x64.exe",
|
11
|
+
"x86_64-darwin" => "tailwindcss-macos-x64",
|
12
|
+
"x86_64-linux" => "tailwindcss-linux-x64",
|
13
|
+
"aarch64-linux" => "tailwindcss-linux-arm64",
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,44 @@
|
|
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
|
+
|
3
|
+
namespace :tailwindcss do
|
4
|
+
desc "Install tailwind plugins"
|
5
|
+
task :install_plugins do
|
6
|
+
plugins = YAML.load_file(Rails.root.join("config", "tailwind.plugins.yml"))
|
7
|
+
|
8
|
+
next unless plugins
|
9
|
+
|
10
|
+
plugins.each do |name, url|
|
11
|
+
dir = Rails.root.join("tmp", "tailwindcss-plugin").to_s
|
12
|
+
|
13
|
+
next if File.exists?(File.join(dir, "#{name}.css"))
|
14
|
+
FileUtils.mkdir_p(dir)
|
15
|
+
|
16
|
+
URI.open(url) do |remote|
|
17
|
+
File.open(File.join(dir, "#{name}.css"), "wb") do |local|
|
18
|
+
local.write(remote.read)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Build your Tailwind CSS"
|
25
|
+
task :build do
|
26
|
+
exec TAILWIND_COMPILE_COMMAND
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "Watch and build your Tailwind CSS on file changes"
|
30
|
+
task :watch do
|
31
|
+
exec "#{TAILWIND_COMPILE_COMMAND} -w"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Rake::Task["tailwindcss:watch"].enhance(["tailwindcss:install_plugins"])
|
36
|
+
Rake::Task["tailwindcss:build"].enhance(["tailwindcss:install_plugins"])
|
37
|
+
|
38
|
+
Rake::Task["assets:precompile"].enhance(["tailwindcss:build"])
|
39
|
+
|
40
|
+
if Rake::Task.task_defined?("test:prepare")
|
41
|
+
Rake::Task["test:prepare"].enhance(["tailwindcss:build"])
|
42
|
+
elsif Rake::Task.task_defined?("db:test:prepare")
|
43
|
+
Rake::Task["db:test:prepare"].enhance(["tailwindcss:build"])
|
44
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
namespace :tailwindcss do
|
2
|
+
desc "Remove CSS builds"
|
3
|
+
task :clobber do
|
4
|
+
rm_rf Dir["app/assets/builds/[^.]*.css"], verbose: false
|
5
|
+
rm_rf Dir["tmp/tailwindcss-plugin/[^.]*.css"], verbose: false
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
Rake::Task["assets:clobber"].enhance(["tailwindcss:clobber"])
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tailwindcss-rails-plugable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.12.pre.dev
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Heinemeier Hansson
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-07-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.0.0
|
27
|
+
description:
|
28
|
+
email: david@loudthinking.com
|
29
|
+
executables:
|
30
|
+
- tailwindcss
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- MIT-LICENSE
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- app/assets/fonts/Inter-italic.alternates.var.woff2
|
38
|
+
- app/assets/fonts/Inter-italic.cyrillic.var.woff2
|
39
|
+
- app/assets/fonts/Inter-italic.extra.var.woff2
|
40
|
+
- app/assets/fonts/Inter-italic.greek.var.woff2
|
41
|
+
- app/assets/fonts/Inter-italic.latin-ext.var.woff2
|
42
|
+
- app/assets/fonts/Inter-italic.latin.var.woff2
|
43
|
+
- app/assets/fonts/Inter-italic.symbols.var.woff2
|
44
|
+
- app/assets/fonts/Inter-italic.vietnamese.var.woff2
|
45
|
+
- app/assets/fonts/Inter-roman.alternates.var.woff2
|
46
|
+
- app/assets/fonts/Inter-roman.cyrillic.var.woff2
|
47
|
+
- app/assets/fonts/Inter-roman.extra.var.woff2
|
48
|
+
- app/assets/fonts/Inter-roman.greek.var.woff2
|
49
|
+
- app/assets/fonts/Inter-roman.latin-ext.var.woff2
|
50
|
+
- app/assets/fonts/Inter-roman.latin.var.woff2
|
51
|
+
- app/assets/fonts/Inter-roman.symbols.var.woff2
|
52
|
+
- app/assets/fonts/Inter-roman.vietnamese.var.woff2
|
53
|
+
- app/assets/stylesheets/inter-font.css
|
54
|
+
- exe/tailwindcss
|
55
|
+
- lib/generators/tailwindcss/controller/controller_generator.rb
|
56
|
+
- lib/generators/tailwindcss/controller/templates/view.html.erb.tt
|
57
|
+
- lib/generators/tailwindcss/mailer/mailer_generator.rb
|
58
|
+
- lib/generators/tailwindcss/mailer/templates/view.html.erb.tt
|
59
|
+
- lib/generators/tailwindcss/mailer/templates/view.text.erb.tt
|
60
|
+
- lib/generators/tailwindcss/scaffold/scaffold_generator.rb
|
61
|
+
- lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt
|
62
|
+
- lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt
|
63
|
+
- lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt
|
64
|
+
- lib/generators/tailwindcss/scaffold/templates/new.html.erb.tt
|
65
|
+
- lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt
|
66
|
+
- lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt
|
67
|
+
- lib/install/Procfile.dev
|
68
|
+
- lib/install/application.tailwind.css
|
69
|
+
- lib/install/dev
|
70
|
+
- lib/install/tailwind.config.js
|
71
|
+
- lib/install/tailwind.plugins.yml
|
72
|
+
- lib/install/tailwindcss.rb
|
73
|
+
- lib/tailwindcss-rails-plugable.rb
|
74
|
+
- lib/tailwindcss/engine.rb
|
75
|
+
- lib/tailwindcss/upstream.rb
|
76
|
+
- lib/tailwindcss/version.rb
|
77
|
+
- lib/tasks/build.rake
|
78
|
+
- lib/tasks/clobber.rake
|
79
|
+
- lib/tasks/install.rake
|
80
|
+
homepage: https://github.com/aaripurna/tailwindcss-rails
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata:
|
84
|
+
homepage_uri: https://github.com/aaripurna/tailwindcss-rails
|
85
|
+
rubygems_mfa_required: 'true'
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 1.3.1
|
100
|
+
requirements: []
|
101
|
+
rubygems_version: 3.3.7
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: A fork from https://github.com/rails/tailwindcss-rails until it supports
|
105
|
+
tailwind plugins
|
106
|
+
test_files: []
|