@333eco/brand 1.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/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 2026 Thon Ly
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/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # brand.333.eco
2
+
3
+ The canonical brand layer for the institution: design tokens, the B-Emblem™, and
4
+ the heartbeat. Vendored into every site that renders them, behind a hash guard.
5
+
6
+ Published as guidelines at **<https://brand.333.eco>** — a page that is *drawn by
7
+ the tokens it documents*, so it cannot drift from them.
8
+
9
+ ## ⚠️ On npm as `@333eco/brand` — a READ-ONLY MIRROR
10
+
11
+ The package exists so that people outside the institution can take what the
12
+ NOTICE invites them to take. **It is not how institution repos get this layer.**
13
+
14
+ > **Institution repos VENDOR this layer. They do not `npm install` it.**
15
+ > `npm run brand:sync -- --from <path to brand.333.eco>`, guarded by
16
+ > `brand.lock`. A dependency range is drift with a number on it, and four
17
+ > consumers were once found three minor versions behind while every guard
18
+ > reported green — see the note further down. Do not add `@333eco/brand` to any
19
+ > repository in this estate.
20
+
21
+ For everyone else: `npm i @333eco/brand`, then import what you need —
22
+ `@333eco/brand/css/tokens.css`, `@333eco/brand/tokens.json`,
23
+ `@333eco/brand/Brand.swift`. The mirror is published from the same commit that
24
+ bumps the version, gated by `scripts/check-publish.mjs`, so it cannot lag behind
25
+ the repository.
26
+
27
+ ## Why this exists
28
+
29
+ This layer lived in four repositories at once — `seysays`, `sayyourname`,
30
+ `playsey` and `333.eco` — as copies, and had already begun to fork. Two of the
31
+ copies were improved on the same day in opposite directions: one refined the
32
+ placement rule's comment, the other rewrote the rule itself and documented why.
33
+ Neither was broken. The next edit that landed in one repo only was the one that
34
+ would bite.
35
+
36
+ It was deliberately **not** extracted earlier, and that was correct: *a design
37
+ system published before it has been used once is a guess.* It has now been used
38
+ four times.
39
+
40
+ ## Why it is on 333.eco
41
+
42
+ The brand serves four GitHub orgs and a dozen domains. Hosting it under any one
43
+ body's TLD would make that body the landlord of the others' identity. `333.eco`
44
+ is the domain that **names no single body** — the same argument that placed
45
+ B-Registry℠ there.
46
+
47
+ ## Layout
48
+
49
+ ```
50
+ css/
51
+ tokens.css Tier A @theme + Tier B -d-/-l- palette pairs + derived accents
52
+ theme-3block.css dark-default cascade with the :not() guard ─┐ pick
53
+ theme-2state.css light-default + .dark stamp ─┘ exactly one
54
+ motion.css @keyframes heartbeat + .beating + the scoped reduce guard
55
+ metta.css the Metta Light session descent (OPT-IN)
56
+ reduce-global.css the estate-wide reduced-motion sweep (OPT-IN)
57
+ emblem/
58
+ emblem.svg reference copy + the home of the rotation warning
59
+ emblem.ts Lit template function
60
+ emblem.path.txt the path `d` string, alone, for generators
61
+ data/
62
+ gems.json gem semantics (MEDIUM). NO hex — those live in tokens.css
63
+ auras.json aura-ramp semantics (RATE). NO hex — same rule
64
+ tlds.json the six-TLD rainbow (DOMAIN). No hex ANYWHERE — see below
65
+ brand.json version, wordmark, mark rules, the accent rule, site map
66
+ dist/ GENERATED, committed: tokens.json · Brand.swift · Brand.kt
67
+ scripts/
68
+ generate.mjs css/ + data/ -> dist/
69
+ check-brand.mjs the drift guard; copied verbatim into every consumer
70
+ site/ the guidelines page -> brand.333.eco (an installable PWA)
71
+ brand.lock every package file -> sha256, plus a version
72
+ ```
73
+
74
+ The page is also **the mark's colour playground**: every mark on it reads
75
+ `--emblem`, and a visitor can point that at any gem or leave it rotating.
76
+ Diamond is in the picker but **not** in the rotation: a cool near-white blinks
77
+ out on the light ground, and a rotation that disappears for a sixth of its cycle
78
+ in one theme is a bug that only shows up in one theme.
79
+
80
+ ⚠️ **The rotation is driven from JS, and this paragraph used to say otherwise.**
81
+ It was built first as pure CSS — an `@property`-registered custom property
82
+ interpolated by `@keyframes` — and that version was wrong on screen in a way
83
+ `getComputedStyle` could not see: the hero mark tracked it while the header mark
84
+ painted its pre-animation colour. Chrome does not re-rasterise an element for an
85
+ animated custom property it *inherits*. The code changed and this file did not,
86
+ so it claimed a property the page does not have — the rotation does **not**
87
+ survive with scripting off. Recorded here because the same technique is the
88
+ obvious way to build the Metta Light, and it will fail the same way.
89
+
90
+ ⚠️ **Rendering the MARK in gem colours is not the thing the gem rule forbids.**
91
+ The rule is that a gem must not become a SITE ACCENT. Hearts in gem colours is
92
+ ratified doctrine — Tonsay's stream is *"7 rainbow hearts: the 6 GEM colours +
93
+ DIAMOND"*. This page's own accent stays a site value and does not move.
94
+
95
+ **No value is typed twice.** `css/tokens.css` is canonical; the JSON holds only
96
+ what a stylesheet cannot say; `dist/` is generated from both.
97
+
98
+ ## Consuming it
99
+
100
+ There is nothing to install and nothing to fetch at build time.
101
+
102
+ ```bash
103
+ # take the current layer (deliberate, reviewable, never CI)
104
+ npm run brand:sync -- --from ../../333.eco/brand.333.eco
105
+
106
+ # verify — no network, no credentials, no sibling checkout
107
+ npm run check:brand
108
+ ```
109
+
110
+ A consumer holds three files from this repo:
111
+
112
+ | File | Differs per repo? |
113
+ |---|---|
114
+ | the vendored `css/` and `emblem/` files | no — byte-identical |
115
+ | `brand.lock` | **no** — byte-identical, so a lagging repo shows an older version in a diff |
116
+ | `check-brand.mjs` | no — byte-identical |
117
+ | `brand.uses` | **yes** — the one file that must differ |
118
+
119
+ `brand.uses` declares what this repo took and where it lives:
120
+
121
+ ```json
122
+ { "dir": "partials", "files": ["tokens.css", "theme-3block.css", "motion.css", "reduce-global.css"] }
123
+ ```
124
+
125
+ ### Concatenation order
126
+
127
+ Not arbitrary. Custom-property substitution is lazy, so a value declared early
128
+ may reference one a later file sets — that is how `--accent`, set per site,
129
+ reaches the derived family.
130
+
131
+ ```
132
+ tokens.css
133
+ + theme-3block.css or theme-2state.css
134
+ + motion.css
135
+ + reduce-global.css (opt-in)
136
+ + brand.css (per site — the accent and the two values that cannot derive)
137
+ + site.css (per site)
138
+ ```
139
+
140
+ ### ⚠️ Never `@import` a sibling of these files
141
+
142
+ The partial-based sites inject their stylesheets as **raw text** and concatenate
143
+ them. A relative `@import` resolves against `src/`, where `partials/` is
144
+ unreachable, and ships a dead render-blocking at-rule — quietly destroying the
145
+ one-request-renders-complete property the inlining exists to buy.
146
+
147
+ `@import "tailwindcss"` at the top of `tokens.css` is a different thing and is
148
+ fine: a bare specifier the Tailwind plugin resolves. Verified to reach `dist`.
149
+
150
+ ## The rules that are easy to break
151
+
152
+ - **A site's accent is DERIVED**, never picked: take the gem whose media type
153
+ *is* that product's medium. Two values cannot derive — `--accent-ink`, and
154
+ `--accent-soft` on a light ground. Measure and pin them per site.
155
+ - **THERE ARE THREE PALETTES AND THEY ARE NOT ONE SYSTEM.** A gem means a
156
+ **medium** (7, `gems.json`); an aura stop means a **rate** (7, `auras.json`);
157
+ a rainbow hue means a **domain** (6, `tlds.json`). The hues rhyme because a
158
+ colour wheel is small. The two sevens are *different sets* — the aura ramp
159
+ carries indigo and ends at violet, the gems carry no indigo and end at
160
+ diamond.
161
+ - **The six-TLD rainbow has NO pinned values, anywhere.** The corpus fixes six
162
+ colour *words*; no file fixes a hex. Do not add six tokens to tidy that up —
163
+ none of the four consumers is a `heartbank.{TLD}`, so they would ship dead
164
+ into all four behind the lock. Pin them when the first one needs them, and
165
+ measure contrast then.
166
+ - **The Metta Light chain lives on `.metta`, never on `:root`.** Custom
167
+ properties inherit their *computed* value, so a chain on `:root` resolves once
168
+ against root's `--t` and every descendant inherits the finished colour — the
169
+ ramp dies silently. The element that sets `--t` must carry the class.
170
+ - **Never register `--metta` with `@property`.** It buys a type and the ability
171
+ to transition it, and transitioning it puts the file straight back inside the
172
+ Chrome inherited-animated-custom-property bug it was written to route around.
173
+ Move `--t` on the app's clock instead.
174
+ - **Pink is absent by construction.** Reserved for B-Dating. Not an oversight —
175
+ and the aura ramp is where the reservation was actually being broken: four
176
+ shipped Phase-1 surfaces were rendering the `indigo` bucket in pink.
177
+ - **Two aura hexes collide with other tokens** — `--color-aura-red` with
178
+ `--danger`, `--color-aura-violet` with `--color-violet-sey`. Coincidence, not
179
+ kinship. Never alias them into each other.
180
+ - **`.beating` goes on CHROME**, never beside a person's name.
181
+ - **The 45° rotation is baked into the path coordinates.** Never a `transform`.
182
+ - **The two theme files are peers.** Converting a site between them is a
183
+ regression, not a tidy-up. So is dropping `reduce-global.css` into seysays.
184
+
185
+ ## Tripwires
186
+
187
+ These fail **silently** — no error at any layer. Check them after touching the
188
+ CSS or the build:
189
+
190
+ ```bash
191
+ # @theme tokens are tree-shaken unless the AUTHOR'S own CSS references them.
192
+ # A token referenced only from runtime JS vanishes and the element renders bare.
193
+ grep -o -- '--color-ruby' site/dist/assets/*.css # must be > 0
194
+ grep -o -- '--color-aura-indigo' site/dist/assets/*.css # must be > 0
195
+ grep -o -- '--beat-duration' site/dist/assets/*.css # must be > 0
196
+
197
+ # The six-TLD marks are painted with CSS KEYWORDS, not tokens, because nothing
198
+ # is pinned. If this ever returns > 0, someone invented six values — check that
199
+ # it was a decision and not a tidy-up.
200
+ grep -o -- '--color-tld' css/tokens.css # must be 0
201
+
202
+ # The Metta ramp dies silently if the chain is hoisted to :root — it resolves
203
+ # once and descendants inherit a frozen colour. The chain must be class-scoped.
204
+ grep -c '^\.metta {' css/metta.css # must be 1
205
+ grep -c '^@property' css/metta.css # must be 0 (prose mentions it)
206
+
207
+ # The custom domain unmaps if this is missing, with a green build.
208
+ test -f site/dist/CNAME
209
+
210
+ # A service worker that ships an unstamped placeholder caches under the literal
211
+ # string "__BUILD_ID__" forever. The build throws instead — but check anyway.
212
+ grep -c '__BUILD_ID__\|__ASSET_LIST__' site/dist/sw.js # must be 0
213
+ ```
214
+
215
+ ### Two that bit this page already
216
+
217
+ **Transforms do not apply to non-replaced inline elements.** `.beating` on a
218
+ bare `<span>` wrapper animates nothing, silently. The header mark and the motion
219
+ demo were both built that way and both sat still. The class goes on the `<svg>`.
220
+
221
+ **XML comments cannot contain a double hyphen.** Writing a CSS custom property
222
+ name the ordinary way inside `icon.svg` makes the file unparseable and the whole
223
+ icon set fails to build. Name tokens in prose there, never in their real syntax.
224
+
225
+ ## Maintaining
226
+
227
+ ```bash
228
+ node scripts/generate.mjs # rewrite dist/
229
+ node scripts/generate.mjs --check # prove dist/ is current (CI)
230
+ node scripts/check-brand.mjs # prove brand.lock matches css/ + emblem/
231
+ node scripts/check-brand.mjs --write # rewrite brand.lock after a change
232
+ cd site && npm run dev # the guidelines page, localhost:57890
233
+ ```
234
+
235
+ **Bump `version` in `data/brand.json`** with any change to `css/` or `emblem/`,
236
+ then run both `--write` steps and commit `brand.lock` and `dist/` in the same
237
+ commit as the change. The version is how "which sites are on which brand" is
238
+ answerable by grep.
239
+
240
+ ## Honest limits
241
+
242
+ - **The fluid type scale does not port to native.** `clamp(min, Nvw, max)` has
243
+ no equivalent; `dist/` emits `min`/`max` and says so. Do not hard-code the max
244
+ and call it done — use the platform's own accessibility scale.
245
+ - **`color-mix(in oklab, …)` is reproduced in `generate.mjs`**, not delegated.
246
+ The values were checked against four independently hand-measured pins in the
247
+ estate and land within a few percent — the differences are exactly the
248
+ contrast corrections those pins exist to make.
249
+ - **`dist/Brand.swift` and `dist/Brand.kt` have no consumer yet.** They were
250
+ written ahead of the first native app, against the rule this package was
251
+ extracted under. They are therefore the least-proven thing here.
252
+
253
+ ## Licence
254
+
255
+ **Apache-2.0** for the code — see [`LICENSE`](./LICENSE).
256
+
257
+ ⚠️ **The marks are not licensed by it, and that is why this licence and not a
258
+ more permissive one.** This repository ships an actual mark, not just the code
259
+ that renders it: the B-Emblem™ is a design mark under filing, and
260
+ `emblem/emblem.svg` is its canonical copy. Apache-2.0 §6 grants no trademark
261
+ rights, which is exactly the posture wanted — **take the architecture, leave the
262
+ mark.** [`NOTICE`](./NOTICE) lists what is reserved and, more usefully, what you
263
+ are positively invited to do with the rest.
264
+
265
+ The design patterns themselves are commons, published as CC0 defensive prior art
266
+ in *Brand Identity as Architecture* (DOI
267
+ [10.5281/zenodo.21947287](https://doi.org/10.5281/zenodo.21947287)), whose §12
268
+ names this repository as its reference implementation. The paper is the
269
+ specification; this is the instantiation.
package/brand.lock ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": "1.3.0",
3
+ "files": {
4
+ "css/metta.css": "9bfe986c46c303bf9a48be85322d68e3d626571a424ef3a8aa81faaf5c866692",
5
+ "css/motion.css": "9bfbe39c0de6a9dfaf9fdc2c61e327b3c8e70221c34dff9befd85da448b9e0c2",
6
+ "css/reduce-global.css": "c2c67276156e8e6803700bbb29d5acad44c9e91c7976d55f7a7e8727294da1f3",
7
+ "css/theme-2state.css": "d579bb887008917fb5586e539182595f851e6a6fc62582a213786aee9550bb06",
8
+ "css/theme-3block.css": "18b99631e9bec0ea53cf3ecbd4f534f3314965f2493909da7bf544b814ddcb0a",
9
+ "css/tokens.css": "b0072fc2fa652ad01521d0e5ba3bbd75f47a8161f10395e3d674db3f5d87deb8",
10
+ "emblem/emblem.path.txt": "8377c7bc7f9ab629058b6ee1d9ec058eedb5f473328bf5017bba056f214c2707",
11
+ "emblem/emblem.svg": "368f520ad2d2f9db50d83ca9cd7aee9475948dc8e38c61b7afa13f7717fef903",
12
+ "emblem/emblem.ts": "6e150389eed576c392ff6231c0b38b8fea5d4c11f7a5b21936bb25afab069890"
13
+ }
14
+ }
package/css/metta.css ADDED
@@ -0,0 +1,190 @@
1
+ /* ============================================================================
2
+ THE METTA LIGHT — the session descent
3
+ ----------------------------------------------------------------------------
4
+ OPT-IN, like reduce-global.css and for the same kind of reason: most surfaces
5
+ have no session to descend. Load it after motion.css on the surfaces that do.
6
+ It is not part of tokens.css and must not be folded into it.
7
+
8
+ THE WHOLE API IS ONE NUMBER. The app sets --t, from 0 at session start to 1 at
9
+ session end. Everything downstream reads --metta and knows nothing about a
10
+ number. Seven stops, ruby to diamond — the B-Gem order, which is what gems.json
11
+ means when it calls that order 'the Metta Light descent'. Until this file the
12
+ order was asserted with nothing to show for it.
13
+
14
+ <div class='metta' style='--t: 0.42'> <- the only line the app writes
15
+ <div class='metta-light'></div>
16
+ <svg class='mark'>...</svg> <- fill: var(--metta)
17
+ </div>
18
+
19
+ ⚠️ NO NUMERALS, NO TOTALS, NO STREAKS, NO RANKS. The light carries the whole
20
+ signal. --t is an input, never a readout: rendering it as '42%' is the exact
21
+ move the guards exist to prevent, and it re-introduces metering into a surface
22
+ built to have none.
23
+
24
+ ──────────────────────────────────────────────────────────────────────────────
25
+ ⚠️⚠️ WHY THIS IS NOT AN ANIMATED CUSTOM PROPERTY, AND THAT IS THE WHOLE POINT.
26
+
27
+ The obvious build — and the one the original CSS reference for this uses — is
28
+ an @property-registered --metta interpolated by @keyframes across the seven
29
+ stops, scrubbed by hanging a negative animation-delay off --t. It demos
30
+ beautifully. THIS REPO HAS ALREADY BEEN BURNED BY IT: see the aura block in
31
+ site/src/page.css. Chrome does not reliably re-rasterise an element for an
32
+ animated custom property it INHERITS, and the failure is invisible to
33
+ getComputedStyle — the hero mark tracked the value while the header mark
34
+ painted its pre-animation colour and reported the animated one. Sticky
35
+ positioning, backdrop-filter and the compositing layer were each ruled out
36
+ separately. The guidelines page had to drive that rotation from JS instead.
37
+
38
+ Inheritance is not incidental here — 'one property, everything downstream reads
39
+ it' IS the design. So the animated-property build is broken in exactly the
40
+ configuration this feature requires, on some elements and not others, silently.
41
+
42
+ So the ramp below computes --metta as a plain value instead of animating one.
43
+ No @property registration, no @keyframes, no animation engine, no JS ticker.
44
+ --t is an ordinary custom property; changing it is an ordinary style mutation,
45
+ which every reader invalidates on, the way every other token in this layer
46
+ already does. There is no enforcer to forget.
47
+
48
+ ⚠️ DO NOT REGISTER --metta WITH @property TO 'TIDY THIS UP'. Registering it
49
+ buys a type and the ability to transition it, and the moment anyone transitions
50
+ it this file is back inside the bug it was written to route around. If a
51
+ surface wants the descent to look continuous, MOVE --t on the app's own clock
52
+ — it is the session's progress and the app already knows it — and never
53
+ transition --metta.
54
+ ──────────────────────────────────────────────────────────────────────────────
55
+
56
+ HOW THE RAMP WORKS. --t scales to a position on six segments, and each stop is
57
+ mixed in with a weight that is 0 before its segment, ramps 0->1 across it, and
58
+ pins at 1 after. clamp() does the windowing, so a stop that has not been
59
+ reached contributes a 0% mix (a no-op) and one already passed contributes 100%
60
+ (a full replacement). Six mixes, evaluated lazily, nothing typed twice: the
61
+ seven stops are the gem tokens themselves, so this file declares no colour.
62
+
63
+ Mixed in OKLAB, matching every other derived colour in this layer. Do not
64
+ 'simplify' to sRGB — the ruby-to-fire-opal and sapphire-to-amethyst legs go
65
+ visibly muddy through it.
66
+ ========================================================================== */
67
+
68
+ /* ⚠️⚠️ THE CHAIN IS DECLARED ON A CLASS, NOT ON :root, AND THAT IS LOAD-BEARING.
69
+ It was written on :root first and the ramp was DEAD — --metta resolved once,
70
+ against :root's own --t, and every descendant then inherited that finished
71
+ colour. Setting --t further down the tree changed nothing and threw no error.
72
+
73
+ The reason is that custom properties inherit their COMPUTED value, not their
74
+ declaration: a descendant does not re-evaluate a chain declared above it, it
75
+ receives the answer. So the element that sets --t must be the element that
76
+ carries the chain, which is what this class is for. Put both on the session
77
+ container; descendants inherit a --metta that is already correct.
78
+
79
+ Caught by measuring the seven stops against the seven gem tokens in a real
80
+ browser — all seven now land on their hex exactly. Do not move these
81
+ declarations to :root to 'make it global'. That is the bug. */
82
+
83
+ .metta {
84
+ /* Session start. A .metta that never sets --t sits at ruby, which is a
85
+ meaningful state and not a broken one. */
86
+ --t: 0;
87
+
88
+ /* Position along six segments, clamped so out-of-range input cannot walk
89
+ off either end of the palette. */
90
+ --metta-seg: clamp(0, calc(var(--t) * 6), 6);
91
+
92
+ /* Per-stop windows. w(i) = clamp(0, seg - i, 1). */
93
+ --metta-w0: clamp(0, var(--metta-seg), 1);
94
+ --metta-w1: clamp(0, calc(var(--metta-seg) - 1), 1);
95
+ --metta-w2: clamp(0, calc(var(--metta-seg) - 2), 1);
96
+ --metta-w3: clamp(0, calc(var(--metta-seg) - 3), 1);
97
+ --metta-w4: clamp(0, calc(var(--metta-seg) - 4), 1);
98
+ --metta-w5: clamp(0, calc(var(--metta-seg) - 5), 1);
99
+
100
+ /* The descent. Each line lays the next gem over the accumulated result. */
101
+ --metta-0: var(--color-ruby);
102
+ --metta-1: color-mix(
103
+ in oklab,
104
+ var(--color-fire-opal) calc(var(--metta-w0) * 100%),
105
+ var(--metta-0)
106
+ );
107
+ --metta-2: color-mix(
108
+ in oklab,
109
+ var(--color-citrine) calc(var(--metta-w1) * 100%),
110
+ var(--metta-1)
111
+ );
112
+ --metta-3: color-mix(
113
+ in oklab,
114
+ var(--color-emerald) calc(var(--metta-w2) * 100%),
115
+ var(--metta-2)
116
+ );
117
+ --metta-4: color-mix(
118
+ in oklab,
119
+ var(--color-sapphire) calc(var(--metta-w3) * 100%),
120
+ var(--metta-3)
121
+ );
122
+ --metta-5: color-mix(
123
+ in oklab,
124
+ var(--color-amethyst) calc(var(--metta-w4) * 100%),
125
+ var(--metta-4)
126
+ );
127
+ --metta: color-mix(
128
+ in oklab,
129
+ var(--color-diamond) calc(var(--metta-w5) * 100%),
130
+ var(--metta-5)
131
+ );
132
+ }
133
+
134
+ /* --------------------------------------------------------------- the lamp ---
135
+ The light itself, as an opt-in component. A surface that only wants the COLOUR
136
+ takes --metta and ignores everything below.
137
+
138
+ The glow is a box-shadow stack rather than a filter because a filter on this
139
+ element would also blur what sits inside it, and the lamp is routinely a
140
+ backdrop for a mark. srgb (not oklab) wherever a mix ends at transparent: a
141
+ rectangular mix against transparent is premultiplied, so srgb gives the
142
+ predictable alpha and oklab does not. Same rule as the alpha family in
143
+ tokens.css. */
144
+
145
+ /* Needs a --metta, so it goes INSIDE a .metta or carries the class itself. On
146
+ its own it inherits nothing and paints with an invalid colour. */
147
+ .metta-light {
148
+ width: var(--metta-size, 12rem);
149
+ aspect-ratio: 1;
150
+ border-radius: 50%;
151
+ background: radial-gradient(
152
+ circle at 50% 42%,
153
+ color-mix(in oklab, var(--metta) 88%, white) 0%,
154
+ var(--metta) 46%,
155
+ color-mix(in srgb, var(--metta) 62%, transparent) 74%,
156
+ transparent 78%
157
+ );
158
+ box-shadow:
159
+ 0 0 3.75rem color-mix(in srgb, var(--metta) 55%, transparent),
160
+ 0 0 8.75rem color-mix(in srgb, var(--metta) 30%, transparent),
161
+ 0 0 15rem color-mix(in srgb, var(--metta) 16%, transparent);
162
+ animation: metta-breathe var(--metta-breath, 6s) ease-in-out infinite;
163
+ }
164
+
165
+ /* Breath, not heartbeat. THE TWO MUST NOT BE CONFUSED and this is a semantic
166
+ boundary rather than a stylistic one: the heartbeat in motion.css is a
167
+ Proof-of-Humanity signal with a placement rule attached, and its morphology is
168
+ the signature. This is a slow symmetrical swell with no claim attached to it.
169
+ Never give the lamp `.beating`, and never give a mark this. */
170
+ @keyframes metta-breathe {
171
+ 0%,
172
+ 100% {
173
+ transform: scale(1);
174
+ filter: brightness(1);
175
+ }
176
+ 50% {
177
+ transform: scale(1.035);
178
+ filter: brightness(1.09);
179
+ }
180
+ }
181
+
182
+ /* The colour is not motion and does not stop here. Only the breath does — the
183
+ descent is the session's own state, and freezing it would misreport where the
184
+ sitter actually is. Same principle as the static mark being Proof of
185
+ Coordinate: a stopped animation must never become a false reading. */
186
+ @media (prefers-reduced-motion: reduce) {
187
+ .metta-light {
188
+ animation: none;
189
+ }
190
+ }