tailwind.com 0.1.0 → 0.3.0
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.
- package/NOTICE +19 -5
- package/README.md +93 -11
- package/licenses/mimalloc.txt +21 -0
- package/package.json +1 -1
- package/runtime/release.json +1 -1
- package/runtime/tailwind.wasm +0 -0
package/NOTICE
CHANGED
|
@@ -10,10 +10,18 @@ source of this repository keeps the license texts in licenses/.
|
|
|
10
10
|
|
|
11
11
|
Tailwind CSS 4.3.5 (the compiler that native/tailwind follows file by
|
|
12
12
|
file, the stylesheets in native/tailwind/assets, the plugin layer in
|
|
13
|
-
native/tailwind/assets/compat.js, the scanner
|
|
14
|
-
and
|
|
13
|
+
native/tailwind/assets/compat.js, the scanner crates in native/scanner
|
|
14
|
+
(crates/oxide and crates/classification-macros of Tailwind CSS), and the
|
|
15
|
+
recorded test data in tests/upstream)
|
|
15
16
|
Copyright (c) Tailwind Labs, Inc.
|
|
16
17
|
MIT License (licenses/tailwindcss.txt).
|
|
18
|
+
|
|
19
|
+
ignore 0.4.33, as Tailwind CSS changed it (the matching of .gitignore
|
|
20
|
+
files for the scanner, in native/scanner/ignore)
|
|
21
|
+
Copyright (c) 2015 Andrew Gallant.
|
|
22
|
+
MIT License or the Unlicense (native/scanner/ignore/LICENSE-MIT,
|
|
23
|
+
native/scanner/ignore/UNLICENSE).
|
|
24
|
+
https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore
|
|
17
25
|
https://github.com/tailwindlabs/tailwindcss
|
|
18
26
|
|
|
19
27
|
Lightning CSS 1.0.0-alpha.72 (the optimizer of --minify and --optimize)
|
|
@@ -33,7 +41,7 @@ packages that Tailwind CSS uses for its source maps)
|
|
|
33
41
|
(licenses/jridgewell.txt).
|
|
34
42
|
|
|
35
43
|
QuickJS 2026-06-04 (the JavaScript engine for @plugin and @config, in
|
|
36
|
-
c_src/quickjs)
|
|
44
|
+
native/tailwind/c_src/quickjs)
|
|
37
45
|
Copyright (c) 2017-2021 Fabrice Bellard; Copyright (c) 2017-2021
|
|
38
46
|
Charlie Gordon.
|
|
39
47
|
MIT License (licenses/quickjs.txt).
|
|
@@ -71,6 +79,12 @@ Cosmopolitan Libc 4.0.2 (the C runtime of the APE file)
|
|
|
71
79
|
of other projects under the licenses that its source names.
|
|
72
80
|
https://github.com/jart/cosmopolitan
|
|
73
81
|
|
|
82
|
+
mimalloc 2.3.2 (the allocator of the file, and of the program of
|
|
83
|
+
"cargo build", from the crate libmimalloc-sys 0.1.49)
|
|
84
|
+
Copyright (c) 2018-2025 Microsoft Corporation, Daan Leijen.
|
|
85
|
+
MIT License (licenses/mimalloc.txt).
|
|
86
|
+
https://github.com/microsoft/mimalloc
|
|
87
|
+
|
|
74
88
|
The Rust standard library and musl (in the Rust library of the file)
|
|
75
89
|
Copyright The Rust Project Developers; Copyright 2005-2020 Rich Felker
|
|
76
90
|
and the contributors of musl.
|
|
@@ -81,9 +95,9 @@ The other Rust crates of Cargo.lock
|
|
|
81
95
|
Each crate has its license in its source (MIT, Apache-2.0, MPL-2.0,
|
|
82
96
|
BSD or Unlicense). "cargo tree" lists them.
|
|
83
97
|
|
|
84
|
-
c_src/cosmo_rust.c, c_src/eh_frame_pad.ld and scripts/rust_link.sh come
|
|
98
|
+
native/tailwind/c_src/cosmo_rust.c, native/tailwind/c_src/eh_frame_pad.ld and scripts/rust_link.sh come
|
|
85
99
|
from BEAM.com (Apache License 2.0), by the same author. The parts of
|
|
86
|
-
c_src/watch.c for inotify and kqueue, and the job bsd of
|
|
100
|
+
native/tailwind/c_src/watch.c for inotify and kqueue, and the job bsd of
|
|
87
101
|
.github/workflows/build.yml, follow the file watcher and the job
|
|
88
102
|
test-bsd of BEAM.com.
|
|
89
103
|
https://github.com/sntran/BEAM.com
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ aarch64.
|
|
|
10
10
|
[BEAM.com](https://github.com/sntran/BEAM.com). It takes the place of:
|
|
11
11
|
|
|
12
12
|
- **The official `tailwindcss` program**: the same options, the same
|
|
13
|
-
output, in one file of about
|
|
13
|
+
output, in one file of about 20 MB for all the systems and both CPUs.
|
|
14
14
|
- **The Hex package `tailwind`** in a Phoenix project: this repository
|
|
15
15
|
is also an Erlang and Elixir project with the application name
|
|
16
16
|
`tailwind`, the module `Tailwind`, and the tasks `mix tailwind` and
|
|
@@ -20,6 +20,10 @@ The compiler follows Tailwind CSS 4.3.5 file by file. The tests compare
|
|
|
20
20
|
its output with the recorded output of the official compiler: see
|
|
21
21
|
[Compatibility](#compatibility).
|
|
22
22
|
|
|
23
|
+
The compiler can also compile as each older version of Tailwind CSS 4,
|
|
24
|
+
from 4.0.0, and the file has the official compiler of each of these
|
|
25
|
+
versions too: see [Versions of Tailwind CSS](#versions-of-tailwind-css).
|
|
26
|
+
|
|
23
27
|
## Quick start
|
|
24
28
|
|
|
25
29
|
```sh
|
|
@@ -56,9 +60,12 @@ tailwind.com [--input input.css] [--output output.css] [--watch] [--poll=ms] [op
|
|
|
56
60
|
In `mix.exs`, replace the Hex package `tailwind`:
|
|
57
61
|
|
|
58
62
|
```elixir
|
|
59
|
-
{:tailwind, github: "sntran/tailwind.com", runtime: Mix.env() == :dev}
|
|
63
|
+
{:tailwind, github: "sntran/tailwind.com", tag: "v0.3.0", runtime: Mix.env() == :dev}
|
|
60
64
|
```
|
|
61
65
|
|
|
66
|
+
The modules of a release download the `tailwind.com` of that release.
|
|
67
|
+
With no `tag`, the modules come from `main`.
|
|
68
|
+
|
|
62
69
|
The configuration of the project does not change:
|
|
63
70
|
|
|
64
71
|
```elixir
|
|
@@ -73,7 +80,11 @@ config :tailwind,
|
|
|
73
80
|
]
|
|
74
81
|
```
|
|
75
82
|
|
|
76
|
-
`
|
|
83
|
+
`version` can be each version of Tailwind CSS 4, for example the
|
|
84
|
+
`"4.3.0"` of a new Phoenix 1.8.9 project: the file has all of them.
|
|
85
|
+
|
|
86
|
+
`mix tailwind.install` downloads `tailwind.com` to the priv directory of
|
|
87
|
+
the application `tailwind` (`Tailwind.install_path/0`), and
|
|
77
88
|
`mix tailwind my_app` runs it. The watcher of the endpoint
|
|
78
89
|
(`tailwind: {Tailwind, :install_and_run, [:my_app, ~w(--watch)]}`) works
|
|
79
90
|
as before: the watch stops when the Phoenix server stops.
|
|
@@ -86,10 +97,22 @@ the official program, byte for byte, for the two layouts of Phoenix 1.8:
|
|
|
86
97
|
daisyUI in `assets/vendor` (to 1.8.5), and daisyUI in `deps/` with
|
|
87
98
|
`NODE_PATH` and the `phoenix-colocated` import (1.8.6 and later).
|
|
88
99
|
|
|
100
|
+
A release has the priv directory of the application `tailwind`, so a
|
|
101
|
+
program can build CSS at run time with `Tailwind.run/2`. For that, the
|
|
102
|
+
line of the dependency must not have `runtime: Mix.env() == :dev` (the
|
|
103
|
+
line of a new Phoenix project): without it, the release does not have
|
|
104
|
+
the application `tailwind`. In a program of BEAM.com, `tailwind.com` runs
|
|
105
|
+
from `/zip`.
|
|
106
|
+
|
|
89
107
|
An Erlang project uses the module `tailwind` (`tailwind:install/0`,
|
|
90
108
|
`tailwind:run/2`), with the same configuration in the application
|
|
91
109
|
environment.
|
|
92
110
|
|
|
111
|
+
The program can also run in the Erlang VM, as a NIF: no process and no
|
|
112
|
+
download, and a small build takes a third of the time. A builder (for
|
|
113
|
+
example the builder of BEAM.com) builds the NIF and puts it in `priv`,
|
|
114
|
+
and the project does not change. See [`docs/NIF.md`](docs/NIF.md).
|
|
115
|
+
|
|
93
116
|
## npm
|
|
94
117
|
|
|
95
118
|
This repository is also the npm package `tailwind.com`:
|
|
@@ -129,6 +152,47 @@ Each release also publishes the package to GitHub Packages, with the
|
|
|
129
152
|
name `@sntran/tailwind.com` (registry `https://npm.pkg.github.com`), and
|
|
130
153
|
holds the package file itself.
|
|
131
154
|
|
|
155
|
+
## Versions of Tailwind CSS
|
|
156
|
+
|
|
157
|
+
One `tailwind.com` compiles for each version of Tailwind CSS 4. The
|
|
158
|
+
variable `TAILWINDCSS_VERSION` selects the version, and the Erlang and
|
|
159
|
+
Elixir modules set it from `version` of the configuration:
|
|
160
|
+
|
|
161
|
+
To try the versions with no install, open the site:
|
|
162
|
+
<https://sntran.github.io/tailwind.com/>. It runs `tailwind.wasm` in the
|
|
163
|
+
browser, and compares two versions, or the Rust compiler with the
|
|
164
|
+
official compiler of one version ([`docs/SITE.md`](docs/SITE.md)).
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
TAILWINDCSS_VERSION=4.1.18 sh ./tailwind.com -i app.css -o dist/app.css
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The file has two engines:
|
|
171
|
+
|
|
172
|
+
- **The native engine** is the Rust compiler. It follows version 4.3.5,
|
|
173
|
+
and it has a switch for each behavior that changed since 4.0.0, so it
|
|
174
|
+
serves each version from 4.0.0 to 4.3.5, also with JavaScript plugins
|
|
175
|
+
([`docs/SWITCHES.md`](docs/SWITCHES.md)). It is the
|
|
176
|
+
fast one: about 12 ms for a Phoenix project, in each version.
|
|
177
|
+
- **The script engine** is the official compiler of the npm package
|
|
178
|
+
`tailwindcss` of a version (one JavaScript file with no dependency),
|
|
179
|
+
with no change, in the QuickJS of the file. It needs about 83 ms for
|
|
180
|
+
the same project, and the official programs need 139 ms to 186 ms. The
|
|
181
|
+
package of each version is in the ZIP directory of the file: an APE
|
|
182
|
+
file is also a ZIP file. The file has the newest package in full, and
|
|
183
|
+
each older version as a small patch: the differences from the next
|
|
184
|
+
newer version. So the 48 versions from 4.0.0 to 4.3.5 are 0.37 MB of
|
|
185
|
+
the file.
|
|
186
|
+
|
|
187
|
+
A new version of Tailwind CSS thus needs one line in the file
|
|
188
|
+
[`PACKAGES`](PACKAGES), and no change of the code. The port to the
|
|
189
|
+
native engine can come later.
|
|
190
|
+
|
|
191
|
+
For another version than 4.3.5, the scanner and the optimizer are still
|
|
192
|
+
the code of this file: with `--minify` or `--optimize`, the text can be
|
|
193
|
+
different from the official program of that version in small details.
|
|
194
|
+
See [`docs/VERSIONS.md`](docs/VERSIONS.md).
|
|
195
|
+
|
|
132
196
|
## Compatibility
|
|
133
197
|
|
|
134
198
|
The output of the official compiler is the specification. `cargo test`
|
|
@@ -155,10 +219,10 @@ tests, and a TLA+ model of the watch.
|
|
|
155
219
|
|
|
156
220
|
[`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) compares the time, the memory
|
|
157
221
|
and the size with the official npm CLI and the official standalone
|
|
158
|
-
program. For example, the Phoenix project:
|
|
159
|
-
|
|
160
|
-
project with daisyUI:
|
|
161
|
-
place of
|
|
222
|
+
program. For example, the Phoenix project: 12 ms with `tailwind.com`,
|
|
223
|
+
186 ms with the npm CLI and 139 ms with the standalone program. A
|
|
224
|
+
project with daisyUI: 182 ms, 310 ms and 251 ms, with 13 MB of memory in
|
|
225
|
+
place of 103 MB and 89 MB.
|
|
162
226
|
|
|
163
227
|
CI runs `tailwind.com` on Linux (x86_64 and aarch64), macOS (arm64 and
|
|
164
228
|
x86_64), Windows (x86_64), FreeBSD, NetBSD and OpenBSD 7.3 (x86_64, in
|
|
@@ -167,10 +231,11 @@ file events of each system (inotify, kqueue, `ReadDirectoryChangesW`)
|
|
|
167
231
|
and with the poll.
|
|
168
232
|
|
|
169
233
|
A differential fuzzer also compares the two compilers live on new random
|
|
170
|
-
stylesheets, classes and projects, in CI for each
|
|
234
|
+
stylesheets, classes and projects, in CI for each change of the compiler
|
|
235
|
+
and each night.
|
|
171
236
|
|
|
172
|
-
The scanner of source files is the Rust
|
|
173
|
-
(`
|
|
237
|
+
The scanner of source files is the Rust code of Tailwind CSS itself
|
|
238
|
+
(`crates/oxide`, a copy with no change in `native/scanner`), and `--minify` and `--optimize` use the same
|
|
174
239
|
version of Lightning CSS with the same options.
|
|
175
240
|
|
|
176
241
|
## JavaScript plugins and configs
|
|
@@ -231,24 +296,41 @@ differences.
|
|
|
231
296
|
earlier.
|
|
232
297
|
- `canonicalize`, the second command of the official program, is not
|
|
233
298
|
there.
|
|
299
|
+
- **Tailwind CSS 3** (a project with only `tailwind.config.js` and
|
|
300
|
+
`@tailwind` rules, and `version: "3.x"`) does not work: it is another
|
|
301
|
+
program. Use the official Hex package or program for it.
|
|
234
302
|
|
|
235
303
|
See [`docs/ROADMAP.md`](docs/ROADMAP.md).
|
|
236
304
|
|
|
305
|
+
## Rust
|
|
306
|
+
|
|
307
|
+
The compiler is also a Rust crate, `tailwind`, with the library
|
|
308
|
+
`tailwind`: compile a stylesheet and build the CSS of the candidates in a
|
|
309
|
+
Rust program, as each version of Tailwind CSS 4. The scanner of Tailwind
|
|
310
|
+
CSS is `tailwind::scanner`. See [`native/tailwind/README.md`](native/tailwind/README.md).
|
|
311
|
+
The release job publishes it to crates.io.
|
|
312
|
+
|
|
237
313
|
## WebAssembly
|
|
238
314
|
|
|
239
315
|
`tailwind.wasm` of each release is the same program for WASI
|
|
240
316
|
(`wasm32-wasip1`): it runs in Node.js, Wasmtime, and other hosts with a
|
|
241
317
|
WASI file system. It has the same JavaScript engine for `@plugin` and
|
|
242
|
-
`@config`, with TypeScript and the three plugins in the file.
|
|
318
|
+
`@config`, with TypeScript and the three plugins in the file. The site
|
|
319
|
+
runs it in the browser, with a small WASI host in JavaScript
|
|
320
|
+
(`site/wasi.mjs`, [`docs/SITE.md`](docs/SITE.md)).
|
|
243
321
|
|
|
244
322
|
## Documentation
|
|
245
323
|
|
|
246
324
|
| File | What |
|
|
247
325
|
|---|---|
|
|
248
326
|
| [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) | The results against Tailwind CSS, and the known differences. |
|
|
327
|
+
| [`docs/VERSIONS.md`](docs/VERSIONS.md) | The versions of Tailwind CSS in the file, and the two engines. |
|
|
328
|
+
| [`docs/SWITCHES.md`](docs/SWITCHES.md) | The Rust compiler as an older version: how to write a switch, and the list of the changes of Tailwind CSS 4.3. |
|
|
249
329
|
| [`docs/INTERNALS.md`](docs/INTERNALS.md) | The parts of the compiler and of the file, and how they relate to Tailwind CSS. |
|
|
250
330
|
| [`docs/BUILDING.md`](docs/BUILDING.md), [`docs/TESTING.md`](docs/TESTING.md) | Build `tailwind.com`, and the tests. |
|
|
251
331
|
| [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) | The time, the memory and the size, against the official programs. |
|
|
332
|
+
| [`docs/SITE.md`](docs/SITE.md) | The site on GitHub Pages: `tailwind.wasm` in the browser, with each version. |
|
|
333
|
+
| [`docs/NIF.md`](docs/NIF.md) | The program as a NIF in the Erlang VM, for a builder such as the builder of BEAM.com. |
|
|
252
334
|
| [`docs/SYNC.md`](docs/SYNC.md) | Move to a new version of Tailwind CSS. |
|
|
253
335
|
| [`docs/ROADMAP.md`](docs/ROADMAP.md) | What comes next. |
|
|
254
336
|
| [`CHANGELOG.md`](CHANGELOG.md) | The changes of each version. |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2025 Microsoft Corporation, Daan Leijen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
package/runtime/release.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version": "0.
|
|
1
|
+
{"version": "0.3.0", "tag": "v0.3.0", "tailwindcss": "4.3.5", "sha256": "3ab81a1a7e6e7c1f074432ff9a123760a8aacda4949cd0acddbd044212a3dd31"}
|
package/runtime/tailwind.wasm
CHANGED
|
Binary file
|