tailwind.com 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,97 @@
1
+ tailwind.com
2
+ Copyright 2026 Sơn Trần-Nguyễn
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see
5
+ LICENSE).
6
+
7
+ The compiler in native/tailwind is a port to Rust of the compiler of
8
+ Tailwind CSS, and the file tailwind.com contains the software below. The
9
+ source of this repository keeps the license texts in licenses/.
10
+
11
+ Tailwind CSS 4.3.5 (the compiler that native/tailwind follows file by
12
+ file, the stylesheets in native/tailwind/assets, the plugin layer in
13
+ native/tailwind/assets/compat.js, the scanner crate tailwindcss-oxide,
14
+ and the recorded test data in tests/upstream)
15
+ Copyright (c) Tailwind Labs, Inc.
16
+ MIT License (licenses/tailwindcss.txt).
17
+ https://github.com/tailwindlabs/tailwindcss
18
+
19
+ Lightning CSS 1.0.0-alpha.72 (the optimizer of --minify and --optimize)
20
+ Copyright Devon Govett and the contributors of Lightning CSS.
21
+ Mozilla Public License 2.0 (licenses/mpl-2.0.txt). The source is at
22
+ https://github.com/parcel-bundler/lightningcss
23
+
24
+ source-map-js 1.2, magic-string 1, and @jridgewell/remapping 2.3 with
25
+ @jridgewell/trace-mapping, @jridgewell/gen-mapping, @jridgewell/resolve-uri
26
+ and @jridgewell/sourcemap-codec (native/tailwind/src/cli/source_maps.rs
27
+ and native/tailwind/src/cli/remapping.rs follow the parts of these
28
+ packages that Tailwind CSS uses for its source maps)
29
+ Copyright (c) 2009-2011, Mozilla Foundation and contributors.
30
+ BSD 3-Clause License (licenses/source-map-js.txt).
31
+ Copyright 2018 Rich Harris. MIT License (licenses/magic-string.txt).
32
+ Copyright 2019-2024 Justin Ridgewell. MIT License
33
+ (licenses/jridgewell.txt).
34
+
35
+ QuickJS 2026-06-04 (the JavaScript engine for @plugin and @config, in
36
+ c_src/quickjs)
37
+ Copyright (c) 2017-2021 Fabrice Bellard; Copyright (c) 2017-2021
38
+ Charlie Gordon.
39
+ MIT License (licenses/quickjs.txt).
40
+ https://github.com/bellard/quickjs (commit e585640)
41
+
42
+ @tailwindcss/forms 0.5.11 with mini-svg-data-uri 1.4.4,
43
+ @tailwindcss/typography 0.5.20 with postcss-selector-parser 6.0.10,
44
+ cssesc 3.0.0 and util-deprecate 1.0.2, and @tailwindcss/aspect-ratio 0.4.2
45
+ (the plugins that the standalone program of Tailwind CSS has in its file,
46
+ in native/tailwind/assets/plugins)
47
+ Copyright (c) Tailwind Labs, Inc.; Copyright (c) 2018 Taylor Hunt;
48
+ Copyright (c) Ben Briggs; Copyright Mathias Bynens; Copyright (c) 2014
49
+ Nathan Rajlich.
50
+ MIT License (licenses/tailwindcss-plugins.txt).
51
+ https://github.com/tailwindlabs/tailwindcss-forms
52
+ https://github.com/tailwindlabs/tailwindcss-typography
53
+ https://github.com/tailwindlabs/tailwindcss-aspect-ratio
54
+
55
+ Sucrase 3.35.1 with lines-and-columns 1.2.4, ts-interface-checker 0.1.13,
56
+ @jridgewell/gen-mapping and @jridgewell/sourcemap-codec (the TypeScript
57
+ transform for TypeScript configs and plugins, in
58
+ native/tailwind/assets/typescript.js)
59
+ Copyright (c) 2012-2018 various contributors (the authors of Sucrase
60
+ and of Babel); Copyright (c) 2015 Brian Donovan. MIT License
61
+ (licenses/sucrase.txt).
62
+ ts-interface-checker: Copyright Grist Labs. Apache License 2.0
63
+ (licenses/sucrase.txt).
64
+ Copyright 2019-2024 Justin Ridgewell. MIT License
65
+ (licenses/jridgewell.txt).
66
+ https://github.com/alangpierce/sucrase
67
+
68
+ Cosmopolitan Libc 4.0.2 (the C runtime of the APE file)
69
+ Copyright 2020 Justine Alexandra Roberts Tunney.
70
+ ISC License (licenses/cosmopolitan.txt). Cosmopolitan also links code
71
+ of other projects under the licenses that its source names.
72
+ https://github.com/jart/cosmopolitan
73
+
74
+ The Rust standard library and musl (in the Rust library of the file)
75
+ Copyright The Rust Project Developers; Copyright 2005-2020 Rich Felker
76
+ and the contributors of musl.
77
+ MIT License or Apache License 2.0 (Rust), MIT License
78
+ (licenses/musl.txt).
79
+
80
+ The other Rust crates of Cargo.lock
81
+ Each crate has its license in its source (MIT, Apache-2.0, MPL-2.0,
82
+ BSD or Unlicense). "cargo tree" lists them.
83
+
84
+ c_src/cosmo_rust.c, c_src/eh_frame_pad.ld and scripts/rust_link.sh come
85
+ 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
87
+ .github/workflows/build.yml, follow the file watcher and the job
88
+ test-bsd of BEAM.com.
89
+ https://github.com/sntran/BEAM.com
90
+
91
+ scripts/remote_ssh_runner.sh and .github/workflows/remote-ssh.yml follow
92
+ the remote SSH workflow of BEAM.com.
93
+
94
+ The test projects in tests/upstream/cli-js contain files of other
95
+ projects (daisyUI, Phoenix, heroicons, topbar and npm packages).
96
+ tests/upstream/cli-js/NOTICE.md names them. They are not in the file
97
+ tailwind.com.
package/README.md CHANGED
@@ -1,3 +1,267 @@
1
- # Temporary Holding Version
1
+ # tailwind.com
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Tailwind CSS 4 in one executable file, with no Node.js. The same file
4
+ runs on Linux, macOS, Windows, FreeBSD, NetBSD and OpenBSD, on x86_64 and
5
+ aarch64.
6
+
7
+ `tailwind.com` is a Tailwind CSS compiler in Rust, as one
8
+ [Actually Portable Executable](https://justine.lol/ape.html) made with
9
+ [Cosmopolitan Libc](https://github.com/jart/cosmopolitan), in the way of
10
+ [BEAM.com](https://github.com/sntran/BEAM.com). It takes the place of:
11
+
12
+ - **The official `tailwindcss` program**: the same options, the same
13
+ output, in one file of about 19 MB for all the systems and both CPUs.
14
+ - **The Hex package `tailwind`** in a Phoenix project: this repository
15
+ is also an Erlang and Elixir project with the application name
16
+ `tailwind`, the module `Tailwind`, and the tasks `mix tailwind` and
17
+ `mix tailwind.install`.
18
+
19
+ The compiler follows Tailwind CSS 4.3.5 file by file. The tests compare
20
+ its output with the recorded output of the official compiler: see
21
+ [Compatibility](#compatibility).
22
+
23
+ ## Quick start
24
+
25
+ ```sh
26
+ curl -fLO https://github.com/sntran/tailwind.com/releases/latest/download/tailwind.com
27
+ sh ./tailwind.com --input app.css --output dist/app.css --minify
28
+ ```
29
+
30
+ On Windows, run `tailwind.com` in the command prompt. With no `--input`,
31
+ the input is `@import "tailwindcss";`. The stylesheets of Tailwind CSS
32
+ (`tailwindcss`, `tailwindcss/theme`, `tailwindcss/preflight`,
33
+ `tailwindcss/utilities`) are in the file.
34
+
35
+ ```
36
+ tailwind.com [--input input.css] [--output output.css] [--watch] [--poll=ms] [options…]
37
+
38
+ -i, --input Input file (- for stdin)
39
+ -o, --output Output file (default: stdout)
40
+ -w, --watch Watch for changes and rebuild as needed; --watch=always
41
+ keeps the watch when stdin closes
42
+ --poll Use polling instead of file system events (--poll=ms
43
+ sets the interval)
44
+ -m, --minify Optimize and minify the output
45
+ --optimize Optimize the output without minifying
46
+ --map Generate a source map: in the output, or with --map=FILE
47
+ in a file
48
+ --cwd The current working directory
49
+ --silent Suppress non-error output
50
+ -h, --help Display usage information
51
+ -v, --version The versions of this program and of Tailwind CSS
52
+ ```
53
+
54
+ ## Phoenix
55
+
56
+ In `mix.exs`, replace the Hex package `tailwind`:
57
+
58
+ ```elixir
59
+ {:tailwind, github: "sntran/tailwind.com", runtime: Mix.env() == :dev}
60
+ ```
61
+
62
+ The configuration of the project does not change:
63
+
64
+ ```elixir
65
+ config :tailwind,
66
+ version: "4.3.5",
67
+ my_app: [
68
+ args: ~w(
69
+ --input=assets/css/app.css
70
+ --output=priv/static/assets/css/app.css
71
+ ),
72
+ cd: Path.expand("..", __DIR__)
73
+ ]
74
+ ```
75
+
76
+ `mix tailwind.install` downloads `tailwind.com` to `_build/`, and
77
+ `mix tailwind my_app` runs it. The watcher of the endpoint
78
+ (`tailwind: {Tailwind, :install_and_run, [:my_app, ~w(--watch)]}`) works
79
+ as before: the watch stops when the Phoenix server stops.
80
+
81
+ A new Phoenix project has `@plugin` lines in `assets/css/app.css` (for
82
+ heroicons and daisyUI). These plugins are JavaScript. The program runs
83
+ them: see [JavaScript plugins and configs](#javascript-plugins-and-configs).
84
+ The output for the project of `mix phx.new` is the same as the output of
85
+ the official program, byte for byte, for the two layouts of Phoenix 1.8:
86
+ daisyUI in `assets/vendor` (to 1.8.5), and daisyUI in `deps/` with
87
+ `NODE_PATH` and the `phoenix-colocated` import (1.8.6 and later).
88
+
89
+ An Erlang project uses the module `tailwind` (`tailwind:install/0`,
90
+ `tailwind:run/2`), with the same configuration in the application
91
+ environment.
92
+
93
+ ## npm
94
+
95
+ This repository is also the npm package `tailwind.com`:
96
+
97
+ ```sh
98
+ npx tailwind.com -i app.css -o dist/app.css --minify
99
+ ```
100
+
101
+ The package does not hold `tailwind.com`. At the first run,
102
+ `npx tailwind.com` downloads the file of its release from GitHub, and
103
+ checks its SHA-256 against the value that the package holds. Then the
104
+ file stays in the cache (`~/.cache/tailwind.com/npm/`).
105
+
106
+ - `TAILWIND_COM`: the path of a `tailwind.com` to use. Then nothing is
107
+ downloaded.
108
+ - `TAILWIND_COM_DOWNLOAD`: the URL of a directory with the file
109
+ `tailwind.com`, in place of the GitHub release.
110
+ - `TAILWIND_COM_CACHE`: the cache directory.
111
+
112
+ The package has the WebAssembly module too, so a program in Node.js 22
113
+ or later can run the compiler in its own process, with no download:
114
+
115
+ ```js
116
+ import { run, runWasm } from 'tailwind.com';
117
+
118
+ // The native program:
119
+ await run(['-i', 'app.css', '-o', 'dist/app.css', '--minify']);
120
+
121
+ // The same program as WebAssembly. The directory `cwd` is all that it sees.
122
+ const { status, stdout, stderr } = await runWasm(['-i', 'app.css'], { cwd: 'project' });
123
+ ```
124
+
125
+ `import wasm from 'tailwind.com/tailwind.wasm'` gives the module itself,
126
+ for another WASI host.
127
+
128
+ Each release also publishes the package to GitHub Packages, with the
129
+ name `@sntran/tailwind.com` (registry `https://npm.pkg.github.com`), and
130
+ holds the package file itself.
131
+
132
+ ## Compatibility
133
+
134
+ The output of the official compiler is the specification. `cargo test`
135
+ replays these records of Tailwind CSS 4.3.5 (`tests/upstream`), and
136
+ expects the same text, byte for byte:
137
+
138
+ | Record | Size |
139
+ |---|---|
140
+ | Each `compile` call of the unit tests of Tailwind CSS | 2,334 calls |
141
+ | Each class of the default design system, each variant, 6,000 random candidates and 784 edge cases, one at a time | 75,082 candidates |
142
+ | The same candidates in one build (the sort of the output) | 24 MB of CSS |
143
+ | `@import "tailwindcss"` with real-world classes, also through the optimizer | 686 candidates |
144
+ | The official command line program on small projects, also the warnings of the optimizer and of `@utility` | 20 projects |
145
+ | The source maps of the official compiler and of its optimizer | 317 stylesheets |
146
+ | The official command line program with `--map`, also with a JavaScript plugin and config | 29 projects |
147
+ | The official command line program on projects with JavaScript and TypeScript plugins and configs (daisyUI, heroicons, `@tailwindcss/typography`, `@tailwindcss/forms`, two Phoenix projects) | 100 projects |
148
+ | The `compile` calls of the unit tests of Tailwind CSS that load a JavaScript plugin or config | 296 calls |
149
+ | Node.js 22 for the parts of Node.js that a plugin gets (`Buffer`, `URL`, timers, `fs`, `util`, ...), and for the files that `require` and `import` find | 124 values, 160 questions |
150
+
151
+ See [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for the results and
152
+ the known differences, and [`docs/TESTING.md`](docs/TESTING.md) for the
153
+ other tests: unit tests from the test files of Tailwind CSS, property
154
+ tests, and a TLA+ model of the watch.
155
+
156
+ [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) compares the time, the memory
157
+ and the size with the official npm CLI and the official standalone
158
+ program. For example, the Phoenix project: 10 ms with `tailwind.com`,
159
+ 141 ms with the npm CLI and 123 ms with the standalone program. A
160
+ project with daisyUI: 140 ms, 241 ms and 186 ms, with 13 MB of memory in
161
+ place of 101 MB and 91 MB.
162
+
163
+ CI runs `tailwind.com` on Linux (x86_64 and aarch64), macOS (arm64 and
164
+ x86_64), Windows (x86_64), FreeBSD, NetBSD and OpenBSD 7.3 (x86_64, in
165
+ a VM): the projects of the official program, and the watch with the
166
+ file events of each system (inotify, kqueue, `ReadDirectoryChangesW`)
167
+ and with the poll.
168
+
169
+ A differential fuzzer also compares the two compilers live on new random
170
+ stylesheets, classes and projects, in CI for each push and each night.
171
+
172
+ The scanner of source files is the Rust crate of Tailwind CSS itself
173
+ (`tailwindcss-oxide`), and `--minify` and `--optimize` use the same
174
+ version of Lightning CSS with the same options.
175
+
176
+ ## JavaScript plugins and configs
177
+
178
+ `@plugin` and `@config` work. The file has a JavaScript engine
179
+ ([QuickJS](https://bellard.org/quickjs/)), and the plugin API is the
180
+ JavaScript of Tailwind CSS itself (`addBase`, `addUtilities`,
181
+ `matchUtilities`, `addComponents`, `matchComponents`, `addVariant`,
182
+ `matchVariant`, `theme()`, `config()`, `plugin.withOptions`, presets,
183
+ `darkMode`, `prefix`, `important`, `content`, `blocklist`).
184
+
185
+ - A module is a CommonJS file or an ES module (`.js`, `.cjs`, `.mjs`),
186
+ a TypeScript file (`.ts`, `.mts`, `.cts`), or a JSON file. `require`
187
+ and `import` find relative files and packages in `node_modules`
188
+ (`exports`, `imports` and `main` of `package.json`), and the
189
+ directories of `NODE_PATH`.
190
+ - **TypeScript**: `@config "./tailwind.config.ts"` and
191
+ `@plugin "./plugin.ts"` work. The program removes the types. It does
192
+ not check them, as the official program.
193
+ - `tailwindcss/plugin`, `tailwindcss/colors`, `tailwindcss/defaultTheme`
194
+ and `tailwindcss/lib/util/flattenColorPalette` are in the file. A
195
+ project needs no `node_modules` for them.
196
+ - `@tailwindcss/forms`, `@tailwindcss/typography` and
197
+ `@tailwindcss/aspect-ratio` are in the file, as in the standalone
198
+ program of Tailwind CSS: `@plugin "@tailwindcss/typography"` works
199
+ with no `node_modules`.
200
+ - A module gets a part of Node.js: `Buffer`, `URL`, `TextEncoder`,
201
+ `setTimeout`, `structuredClone`, `process.env`, and the modules `fs`
202
+ (reads only), `path`, `os`, `url`, `util`, `assert` and `module`.
203
+ - A module cannot write files, start a process, or open a network
204
+ connection: such a call throws an error that names the rule (see
205
+ [`SECURITY.md`](SECURITY.md)).
206
+ - The watch builds again when a plugin or config file changes.
207
+
208
+ What does not work:
209
+
210
+ - **The other modules of Node.js** (`crypto`, `stream`, `events`,
211
+ `zlib`, ...), `Intl` and `Temporal`. A plugin that needs them at load
212
+ time gives an error.
213
+ - **A TypeScript file with JSX** (`.tsx`), and decorators.
214
+ - **`import "tailwindcss"` for a value** in a config (the full compiler
215
+ as a JavaScript module). `import type { Config } from "tailwindcss"`
216
+ works: a type import has no JavaScript.
217
+
218
+ See [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for all the
219
+ differences.
220
+
221
+ ## Limits
222
+
223
+ - **Source maps of the stylesheets in the file**: with `--map`, a
224
+ source of a stylesheet of Tailwind CSS that is in the program has the
225
+ path `/$tailwindcss/NAME.css`. With `node_modules/tailwindcss` in the
226
+ project, the path is the path of the file, as with the official
227
+ program.
228
+ - **NetBSD and OpenBSD**: the `sh` of NetBSD cannot read an APE file.
229
+ Start the file there with the APE loader of cosmocc
230
+ (`ape-x86_64.elf tailwind.com`). Cosmopolitan supports OpenBSD 7.3 or
231
+ earlier.
232
+ - `canonicalize`, the second command of the official program, is not
233
+ there.
234
+
235
+ See [`docs/ROADMAP.md`](docs/ROADMAP.md).
236
+
237
+ ## WebAssembly
238
+
239
+ `tailwind.wasm` of each release is the same program for WASI
240
+ (`wasm32-wasip1`): it runs in Node.js, Wasmtime, and other hosts with a
241
+ WASI file system. It has the same JavaScript engine for `@plugin` and
242
+ `@config`, with TypeScript and the three plugins in the file.
243
+
244
+ ## Documentation
245
+
246
+ | File | What |
247
+ |---|---|
248
+ | [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) | The results against Tailwind CSS, and the known differences. |
249
+ | [`docs/INTERNALS.md`](docs/INTERNALS.md) | The parts of the compiler and of the file, and how they relate to Tailwind CSS. |
250
+ | [`docs/BUILDING.md`](docs/BUILDING.md), [`docs/TESTING.md`](docs/TESTING.md) | Build `tailwind.com`, and the tests. |
251
+ | [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) | The time, the memory and the size, against the official programs. |
252
+ | [`docs/SYNC.md`](docs/SYNC.md) | Move to a new version of Tailwind CSS. |
253
+ | [`docs/ROADMAP.md`](docs/ROADMAP.md) | What comes next. |
254
+ | [`CHANGELOG.md`](CHANGELOG.md) | The changes of each version. |
255
+
256
+ ## Contributing
257
+
258
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md). Report a security problem in
259
+ private: see [`SECURITY.md`](SECURITY.md).
260
+
261
+ ## License
262
+
263
+ tailwind.com is licensed under the [Apache License 2.0](LICENSE). The
264
+ compiler is a port of Tailwind CSS (MIT License), and the file
265
+ `tailwind.com` contains other software under its own licenses:
266
+ [`NOTICE`](NOTICE) names them, and the license texts are in
267
+ [`licenses/`](licenses).