mocha-ui-themes 0.0.0-stage → 1.0.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.

Potentially problematic release.


This version of mocha-ui-themes might be problematic. Click here for more details.

Files changed (59) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE.md +20 -0
  3. package/README.md +167 -3
  4. package/UPSTREAM.json +43 -0
  5. package/base.css +46 -0
  6. package/build-cache.mjs +2 -0
  7. package/cache-sweep.mjs +2 -0
  8. package/cache-warm.mjs +2 -0
  9. package/index.css +2 -0
  10. package/lib.cjs +26 -0
  11. package/lib.mjs +22 -0
  12. package/native/LICENSE-node-vm-detect.txt +21 -0
  13. package/native/darwin/arm64/cache-probe.node +0 -0
  14. package/native/darwin/x64/cache-probe.node +0 -0
  15. package/native/linux/arm64/cache-probe.node +0 -0
  16. package/native/linux/x64/cache-probe.node +0 -0
  17. package/native/win32/arm64/cache-probe.node +0 -0
  18. package/native/win32/x64/cache-probe.node +0 -0
  19. package/package.json +104 -6
  20. package/preflight.css +1 -0
  21. package/theme.css +2 -0
  22. package/themes.css +690 -0
  23. package/tokens.mjs +281 -0
  24. package/utilities.css +1 -0
  25. package/vendor/tailwindcss/LICENSE +21 -0
  26. package/vendor/tailwindcss/README.md +36 -0
  27. package/vendor/tailwindcss/dist/chunk-5JIJA4QV.mjs +1 -0
  28. package/vendor/tailwindcss/dist/chunk-C2OYBFIH.mjs +1 -0
  29. package/vendor/tailwindcss/dist/chunk-DCG7AFIE.mjs +1 -0
  30. package/vendor/tailwindcss/dist/colors-C__qRT83.d.ts +347 -0
  31. package/vendor/tailwindcss/dist/colors.d.mts +347 -0
  32. package/vendor/tailwindcss/dist/colors.d.ts +5 -0
  33. package/vendor/tailwindcss/dist/colors.js +1 -0
  34. package/vendor/tailwindcss/dist/colors.mjs +1 -0
  35. package/vendor/tailwindcss/dist/default-theme.d.mts +1199 -0
  36. package/vendor/tailwindcss/dist/default-theme.d.ts +1199 -0
  37. package/vendor/tailwindcss/dist/default-theme.js +1 -0
  38. package/vendor/tailwindcss/dist/default-theme.mjs +1 -0
  39. package/vendor/tailwindcss/dist/flatten-color-palette.d.mts +6 -0
  40. package/vendor/tailwindcss/dist/flatten-color-palette.d.ts +6 -0
  41. package/vendor/tailwindcss/dist/flatten-color-palette.js +1 -0
  42. package/vendor/tailwindcss/dist/flatten-color-palette.mjs +1 -0
  43. package/vendor/tailwindcss/dist/lib.d.mts +379 -0
  44. package/vendor/tailwindcss/dist/lib.d.ts +3 -0
  45. package/vendor/tailwindcss/dist/lib.js +38 -0
  46. package/vendor/tailwindcss/dist/lib.mjs +38 -0
  47. package/vendor/tailwindcss/dist/plugin.d.mts +11 -0
  48. package/vendor/tailwindcss/dist/plugin.d.ts +134 -0
  49. package/vendor/tailwindcss/dist/plugin.js +1 -0
  50. package/vendor/tailwindcss/dist/plugin.mjs +1 -0
  51. package/vendor/tailwindcss/dist/resolve-config-B4yBzhca.d.ts +29 -0
  52. package/vendor/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  53. package/vendor/tailwindcss/dist/types-DWdTiksJ.d.mts +128 -0
  54. package/vendor/tailwindcss/index.css +950 -0
  55. package/vendor/tailwindcss/package.json +89 -0
  56. package/vendor/tailwindcss/preflight.css +398 -0
  57. package/vendor/tailwindcss/theme.css +510 -0
  58. package/vendor/tailwindcss/utilities.css +1 -0
  59. package/workspaces.js +2 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) Tailwind Labs, Inc.
4
+ Copyright (c) 2026 Noel C (theme additions)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,20 @@
1
+ # Upstream attribution
2
+
3
+ This is an independent, opinionated distribution derived from Tailwind CSS 4.3.3.
4
+ It is not an official Tailwind Labs product.
5
+
6
+ `vendor/tailwindcss/` contains the unmodified published Tailwind CSS distribution,
7
+ including its compiler, types, CSS, package metadata, and original MIT license.
8
+ The exact source version, npm archive integrity, and individual file hashes are
9
+ recorded in `UPSTREAM.json`. Original source is available at:
10
+ https://github.com/tailwindlabs/tailwindcss/tree/v4.3.3
11
+
12
+ Our changes are the package identity, additive semantic theme layer, opt-in base
13
+ styles, and compatibility tooling. The upstream compiler is intentionally retained
14
+ to preserve existing utility syntax and plugin behavior. `npm run check:upstream`
15
+ checks the vendored distribution before release.
16
+
17
+ To upgrade: obtain the new upstream release, verify its registry integrity, replace
18
+ the vendor directory and hash manifest, review its export map, align integration
19
+ dependency versions, and run the complete compatibility suite. Do not hand-edit
20
+ the compiled upstream bundles.
package/README.md CHANGED
@@ -1,3 +1,167 @@
1
- # Temporary Holding Version
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.
1
+ # mocha-ui-themes
2
+
3
+ [![npm version](https://img.shields.io/npm/v/mocha-ui-themes.svg)](https://www.npmjs.com/package/mocha-ui-themes)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](#license)
5
+ [![Node](https://img.shields.io/badge/node-%3E%3D20-green.svg)](#requirements)
6
+
7
+ Semantic color themes for Tailwind CSS 4. Keep every utility you already
8
+ use, and add coordinated palettes with light, dark, and system modes, plus
9
+ optional scoped base styling. This initial release derives from
10
+ **Tailwind CSS 4.3.3** and retains its unmodified compiler and public entry
11
+ points (see [NOTICE.md](./NOTICE.md) and [UPSTREAM.json](./UPSTREAM.json)).
12
+
13
+ ## Highlights
14
+
15
+ - Six coordinated palettes: `ocean` (default), `forest`, `ember`, `gruvbox`,
16
+ `dracula`, and `catppuccin`.
17
+ - One attribute switches light, dark, or system mode; no utility rewrites.
18
+ - Semantic tokens (`bg-primary`, `text-muted`, `border-danger`, ...) that
19
+ work with ordinary Tailwind modifiers and opacity.
20
+ - Text/background pairings checked for a 4.5:1 contrast ratio.
21
+ - Optional base styling for buttons, fields, and headings, scoped behind an
22
+ opt-in attribute.
23
+ - Zero runtime JavaScript; plain CSS custom properties, generated at build
24
+ time and shipped ready to use.
25
+
26
+ ## Requirements
27
+
28
+ - Tailwind CSS **4.3.3** and its matching `@tailwindcss/postcss` adapter.
29
+ Other versions and Vite/CLI integrations are not yet verified.
30
+ - Node.js >= 20 to build or develop the kit; consumers need no build step.
31
+
32
+ ## Install
33
+
34
+ ### Alongside upstream (reversible)
35
+
36
+ Keep Tailwind as-is and layer the themes on top:
37
+
38
+ ```sh
39
+ npm install -D mocha-ui-themes
40
+ ```
41
+
42
+ ```css
43
+ @import "tailwindcss";
44
+ @import "mocha-ui-themes/themes.css";
45
+ ```
46
+
47
+ Only the `--twt-*` custom properties are added by the second import; remove it
48
+ to return to stock Tailwind.
49
+
50
+ ### Drop-in replacement
51
+
52
+ Install the kit under the `tailwindcss` dependency name to keep existing
53
+ imports, JavaScript plugin imports, and PostCSS configuration untouched:
54
+
55
+ ```sh
56
+ npm install -D tailwindcss@npm:mocha-ui-themes
57
+ ```
58
+
59
+ ```css
60
+ @import "tailwindcss";
61
+ ```
62
+
63
+ Keep `@tailwindcss/postcss` at version `4.3.3`. Its compiler dependency may
64
+ install a separate upstream copy; your app's CSS import still resolves to this
65
+ package.
66
+
67
+ ## Usage
68
+
69
+ Choose a palette and mode on the document root:
70
+
71
+ ```html
72
+ <html data-theme="forest" data-mode="dark">
73
+ ```
74
+
75
+ The default palette is `ocean`. `data-mode="light"` and `data-mode="dark"`
76
+ are explicit overrides; omit `data-mode` to follow the operating system. A
77
+ nested theme island should specify both `data-theme` and `data-mode`
78
+ explicitly.
79
+
80
+ ```html
81
+ <section class="rounded-xl border border-border bg-surface p-6 text-foreground">
82
+ <p class="text-muted">Your theme changes; these classes stay the same.</p>
83
+ <button class="rounded-lg bg-primary px-4 py-2 text-primary-foreground hover:bg-primary-hover">
84
+ Save changes
85
+ </button>
86
+ </section>
87
+ ```
88
+
89
+ Available color tokens:
90
+
91
+ | Purpose | Tokens |
92
+ | --- | --- |
93
+ | Surfaces | `background`, `surface`, `surface-raised` |
94
+ | Text and borders | `foreground`, `muted`, `border`, `ring` |
95
+ | Main action | `primary`, `primary-hover`, `primary-foreground` |
96
+ | Secondary action | `secondary`, `secondary-foreground` |
97
+ | Feedback | `success`, `warning`, `danger`, each with a `-foreground` companion |
98
+
99
+ Tokens work with ordinary Tailwind modifiers, including `hover:bg-primary`,
100
+ `md:text-muted`, and `bg-primary/50`. App-level `@theme` declarations can
101
+ override semantic colors. The common misspelling `catpuccin` is accepted as
102
+ an alias for the Catppuccin palette.
103
+
104
+ **Theming and Tailwind's `dark:` variant are separate.** `data-mode` switches
105
+ semantic values. The existing `dark:` variant keeps its upstream media-query
106
+ behavior, preserving compatibility.
107
+
108
+ ## Optional base styling
109
+
110
+ ```css
111
+ @import "mocha-ui-themes/base.css";
112
+ ```
113
+
114
+ ```html
115
+ <body data-twt-ui>
116
+ <button>Uses the theme's action styles</button>
117
+ </body>
118
+ ```
119
+
120
+ This opts into heading, button, field, focus, and page defaults. The styles
121
+ live in the base layer, so utility classes can override them. Remove this
122
+ import before switching back to upstream, which does not export `base.css`.
123
+
124
+ ## Compatibility contract
125
+
126
+ - Existing utility names, palettes, spacing, typography, breakpoints, and
127
+ Preflight retain their upstream behavior. Default imports add custom
128
+ properties only.
129
+ - Themes add `bg-primary`, `text-muted`, `border-danger`, and related
130
+ utilities. They do not redefine classes such as `bg-teal-600` or
131
+ `rounded-xl`.
132
+ - Base element styling requires both a separate CSS import and `data-twt-ui`.
133
+ - CSS generation is verified against upstream Tailwind 4.3.3: standard
134
+ variants, palettes, arbitrary values, and utilities generate identical CSS,
135
+ excluding the new `--twt-*` custom properties.
136
+
137
+ ## Local development
138
+
139
+ ```sh
140
+ npm ci
141
+ npm test
142
+ npm run check:upstream
143
+ npm run demo:build
144
+ ```
145
+
146
+ Open `examples/playground/index.html` after building the demo to switch
147
+ between all six palettes in light, dark, or system mode.
148
+ `npm run demo:check` verifies computed theme colors and controls in a headless
149
+ browser, including system dark mode (set `CHROME_PATH` for a non-default
150
+ Chrome/Chromium installation).
151
+
152
+ `src/themes.mjs` is the source of truth for palettes; `npm run build`
153
+ regenerates `themes.css`. Generated CSS is included in the npm package, so
154
+ consumers need no theme-generation step.
155
+
156
+ ## Provenance
157
+
158
+ The compiler is vendored from the verified upstream npm distribution so the
159
+ package is self-contained. See [NOTICE.md](./NOTICE.md) for third-party
160
+ notices and [UPSTREAM.json](./UPSTREAM.json) for provenance and upgrade
161
+ instructions. This is a theme kit release, not a separate compiler
162
+ implementation, and is not affiliated with Tailwind Labs.
163
+
164
+ ## License
165
+
166
+ MIT. Original Tailwind Labs notices are preserved, with attribution for the
167
+ additional theme work.
package/UPSTREAM.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "tailwindcss",
3
+ "version": "4.3.3",
4
+ "source": "https://github.com/tailwindlabs/tailwindcss/tree/v4.3.3",
5
+ "tarball": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz",
6
+ "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==",
7
+ "files": {
8
+ "dist/chunk-5JIJA4QV.mjs": "c24e6bf22af878f559ed55bf81c6023d0413abd0e7854286944088cb44473149",
9
+ "dist/chunk-C2OYBFIH.mjs": "4b15bfa07f438749d3512e4e0decfa2acdb4c3268e3293853af51bdf1b0535f4",
10
+ "dist/chunk-DCG7AFIE.mjs": "b162bd2089f644e13bbd7138a5efe678f837b55e513b51bc9ed0002d64ddd85b",
11
+ "dist/colors-C__qRT83.d.ts": "dd0d82b8bd458da790d190a58fda615ce8afb4e015ccfafda27765c2639298d1",
12
+ "dist/colors.d.mts": "ed6ef11fe4001f6089f47361e0574567857514703825ac05872bcaa752df02f1",
13
+ "dist/colors.d.ts": "af45d2740e699977c3adbf47abb04ff45d3403021931599017b99258510bd567",
14
+ "dist/colors.js": "1bcf4a87977eb0dd5d97ebb3fa8f86a94960e04432b9bda11cc452680bb3a8a1",
15
+ "dist/colors.mjs": "7d8ab04dd25d73a352046154acf703317511d870ff9303d3724e09919ef0fd8b",
16
+ "dist/default-theme.d.mts": "b04171c8fd7a517cb5e6b479b1ca889ea1fdef98c844e32e128407e73e52340e",
17
+ "dist/default-theme.d.ts": "9804f3cc1f9a20e96f11e9bd08f8ba3b058169f258f9f58acc5d84698e626fe7",
18
+ "dist/default-theme.js": "147be701807ff7342b81a4f2c8bf63f61515f3a85307d60e4b5a37c1145fe540",
19
+ "dist/default-theme.mjs": "49ae2de009d4cdaec3c37a09bde834ddbb4692814af448f2f1a52af725de145d",
20
+ "dist/flatten-color-palette.d.mts": "0cf62ae5406e942c2ec4d1c93c0388cebbbdc01812eb2fc69fd3f8a5fc328ed1",
21
+ "dist/flatten-color-palette.d.ts": "0cf62ae5406e942c2ec4d1c93c0388cebbbdc01812eb2fc69fd3f8a5fc328ed1",
22
+ "dist/flatten-color-palette.js": "fc677f08e9e4e7e1f24d580fa622aa11adabdc7a90e9322338ab56c5aabd8cb4",
23
+ "dist/flatten-color-palette.mjs": "62b5ba008d1566947ed5baa5b162f5d8dbf75f9a6deaba6b09cb79bfac00a359",
24
+ "dist/lib.d.mts": "cd9a12144f9364eeed4c40b44e2d30cd884467aa7154ab8f379425943e5d39fc",
25
+ "dist/lib.d.ts": "c3041279151dd9ae22f718f83cd52cbe069b8b994420444ef9fce1e4d0568be3",
26
+ "dist/lib.js": "934fd25eee4dc84b2bb168b751816bba4c29cc6ed665a86ef6d6594c54da80d8",
27
+ "dist/lib.mjs": "8ebfd51c44d6cca0ef675007e97e6aa918944df2b662c2d7bfa50fdfaa98bb64",
28
+ "dist/plugin.d.mts": "423f604a78916e33620f20942748a28ed43c41a968871c4fe41f896ee7a6afaf",
29
+ "dist/plugin.d.ts": "f9c7de1181bddfe5b8796d22a025e44ca7d4ae069b26b953460aa19fb5d24ef6",
30
+ "dist/plugin.js": "5564284a5af01cc76f2cfa4e32631ffd58368c167ecac60664b351f895732d19",
31
+ "dist/plugin.mjs": "3e62ce6dd41a0540dc04af03149fc30f65934c34dd10e3abc57eebc6e6acecb2",
32
+ "dist/resolve-config-B4yBzhca.d.ts": "171c8fc22d735433308be43d5a01887f3c07efa09b140867df1f331bca380b4d",
33
+ "dist/resolve-config-QUZ9b-Gn.d.mts": "397e0cbdbbdc4341e7841c3c63d8507c177119abf07532cf276f81fad1da7442",
34
+ "dist/types-DWdTiksJ.d.mts": "6a4f90e26876d82510869f5c55b6d24fd0fdb69a6b3fe6d53efa35f8f559dae6",
35
+ "index.css": "175f88737ecb7e033059eac4a3b22a3b5f971d5a05d9fd50811610a0714633b2",
36
+ "LICENSE": "60e0b68c0f35c078eef3a5d29419d0b03ff84ec1df9c3f9d6e39a519a5ae7985",
37
+ "package.json": "3dc86b46c511947ca00838aa3f1776243abe923ac347c092e60a0cbc7ae68559",
38
+ "preflight.css": "ace8310eed6dc5568a56fc16e1d695cf58da7528d81d66d81649e93cce644df6",
39
+ "README.md": "a7db79d5cd483c6f6d1a51f4042e32598ec39e2391a5dd5be62a71d59299cda8",
40
+ "theme.css": "443d7af364200f8ec8352dc78e39485a118a1840d498c97967bf0ae402b39167",
41
+ "utilities.css": "0e5844ec75de2fb4a76097b26bb624bf8f9d9cf59f6d947855b743dd25f920fb"
42
+ }
43
+ }
package/base.css ADDED
@@ -0,0 +1,46 @@
1
+ /* Optional defaults. Import after tailwindcss; opt in with data-twt-ui. */
2
+ @layer base {
3
+ :where([data-twt-ui]) {
4
+ color: var(--twt-foreground);
5
+ background-color: var(--twt-background);
6
+ accent-color: var(--twt-primary);
7
+ }
8
+
9
+ :where([data-twt-ui]) :is(h1, h2, h3, h4) {
10
+ font-weight: 700;
11
+ line-height: 1.2;
12
+ letter-spacing: -0.025em;
13
+ }
14
+
15
+ :where([data-twt-ui]) :is(button, input, select, textarea) {
16
+ border-radius: 0.75rem;
17
+ }
18
+
19
+ :where([data-twt-ui]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) {
20
+ border: 1px solid var(--twt-border);
21
+ background-color: var(--twt-surface);
22
+ color: var(--twt-foreground);
23
+ padding: 0.625rem 0.875rem;
24
+ }
25
+
26
+ :where([data-twt-ui]) button {
27
+ background-color: var(--twt-primary);
28
+ color: var(--twt-primary-foreground);
29
+ padding: 0.625rem 1rem;
30
+ font-weight: 600;
31
+ }
32
+
33
+ :where([data-twt-ui]) button:not(:disabled):hover {
34
+ background-color: var(--twt-primary-hover);
35
+ }
36
+
37
+ :where([data-twt-ui]) :is(a, button, input, select, textarea):focus-visible {
38
+ outline: 2px solid var(--twt-ring);
39
+ outline-offset: 3px;
40
+ }
41
+
42
+ :where([data-twt-ui]) button:disabled {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ }
46
+ }