code wiki / _hdl_build / nx_brand_tokens.nx

nx_brand_tokens.nx

buildroot/runtime/_hdl_build/nx_brand_tokens.nx

14403 B321 linesdepth 2pulls 2 transitivereach 81 importersview sourcekind librarytopic brand
docsdependenciesstructsconstsfunctions

about

nx_brand_tokens.nx -- R1 of the S-class BRAND arc: the DESIGN-TOKEN SSOT (single source of truth). Operator 2026-06-21: "we need real s class nike/coca-cola brand management exceed tools ... users + developers + ai-users + local-llm able to manage in lots of ways to NOT lock in." Design tokens are LITERALLY what a Nike/Coca-Cola brand system is built on: color/type/space/radius/motion captured ONCE as portable DATA, then every surface consumes them -- so re-branding is a data edit, not a code edit, and the brand is diffable / versionable / editable by ANY actor (human, dev, AI, local-LLM) = no vendor lock-in BY CONSTRUCTION. FORMAT (the .brand DATA, line-based, pipe-delimited, mirrors the proven .site idiom): token|<group>|<name>|<value> e.g. token|color|primary|#0b2545 EMIT: a W3C-DTCG-spirit CSS custom-properties block :root{ --nx-<group>-<name>: <value>; ... } that nx_web_builder/wb_doc_open will consume via var(--nx-*) (R1b) so a token swap re-themes with NO code change. SOVEREIGNTY + INJECTION SAFE BY CONSTRUCTION (rule 12 boundary defense): bt_value_safe REJECTS any value carrying a CSS-structural breakout char ({ } ; < >) or a third-party-fetch / comment substring (script, src=, url(, /*) -> no <script>, no external fetch, no CSS rule-injection can pass, in ANY brand. group/name are ident-checked (alnum + '-') so the custom-property name itself can never be broken. Library (no main). 100% sovereign (nx_cc->nxasm, no gcc/JS). license_tier: ORIGINAL

dependencies 1 imports · 39 importers

nx_syscalls.nx nx_brand_tokens.nx nx_a11y_breadth.nx nx_a11y_breadth_gate.nx nx_brand_aesthetic.nx nx_brand_aesthetic_gate.nx nx_brand_assets_gate.nx nx_brand_book.nx nx_brand_book_gate.nx nx_brand_builder_gate.nx nx_brand_dark_gate.nx nx_brand_exceed2_gate.nx

diagram shows first 10 each side; +0 more imports, +29 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_a11y_breadth.nxnx_a11y_breadth_gate.nxnx_brand_aesthetic.nxnx_brand_aesthetic_gate.nxnx_brand_assets_gate.nxnx_brand_book.nxnx_brand_book_gate.nxnx_brand_builder_gate.nxnx_brand_dark_gate.nxnx_brand_exceed2_gate.nxnx_brand_exceed3_gate.nxnx_brand_exceed_gate.nxnx_brand_gallery_gate.nxnx_brand_guard.nxnx_brand_manage.nxnx_brand_manage_gate.nxnx_brand_packs_gate.nxnx_brand_polish_gate.nxnx_brand_preview.nxnx_brand_spacescale.nxnx_brand_spacescale_gate.nxnx_brand_tokens_gate.nxnx_brand_typescale.nxnx_brand_typescale_gate.nxnx_clarity.nxnx_clarity_gate.nxnx_editor_loop_gate.nxnx_editor_render_gate.nxnx_exceed_standard_gate.nxnx_internal_sweep_gate.nxnx_meet_about.nxnx_meet_emit.nxnx_meet_intake.nxnx_meet_jobs.nxnx_pub_todos.nxnx_site_import_gate.nxnx_site_migrate.nxnx_site_migrate_gate.nxnx_web_builder.nx

structs

none

consts

none

functions

20func bt_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
23func bt_find(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64
37func bt_app(out: *u8, pos: i64, cap: i64, s: *u8) -> i64
44func bt_app_n(out: *u8, pos: i64, cap: i64, s: *u8, n: i64) -> i64
52func bt_slice_eq(text: *u8, s: i64, e: i64, lit: *u8, litlen: i64) -> i64
60func bt_ident_safe(s: *u8, n: i64) -> i64
77func bt_value_safe(s: *u8, n: i64) -> i64
98func bt_emit_root_buf(text: *u8, n: i64, out: *u8, cap: i64) -> i64
151func bt_emit_root_fd(text: *u8, n: i64, fd: i64) -> i64
162func bt_default_brand() -> *u8
called by 17: mainmainmainmainmainmain+11
167func bt_default_emit(out: *u8, cap: i64) -> i64
174func bt_lookup(text: *u8, n: i64, group: *u8, name: *u8, out: *u8, cap: i64) -> i64
209func bt_emit_token_line(out: *u8, pos: i64, cap: i64, group: *u8, name: *u8, value: *u8) -> i64
called by 1: bt_set calls 1: bt_app
223func bt_set(text: *u8, n: i64, group: *u8, name: *u8, value: *u8, out: *u8, cap: i64) -> i64
269func bt_emit_dark_root_buf(text: *u8, n: i64, out: *u8, cap: i64) -> i64
314func bt_emit_dark_fd(text: *u8, n: i64, fd: i64) -> i64