code wiki / _hdl_build / nx_nishi_editorial.nx
nx_nishi_editorial.nx
buildroot/runtime/_hdl_build/nx_nishi_editorial.nx
about
nx_nishi_editorial.nx -- LIB: THE estate's editorial design system, emitted as sovereign zero-JS CSS.
Every generated surface used to hand-roll its own stylesheet, which is why the estate reads like a dozen
different products. This is the ONE canonical system: adopt it, do not copy it (rule 15 -- the pattern is
past three call sites, so it belongs in a lib). Tuned against a reference editorial artifact: flat, 2px
radii, ZERO shadows, ZERO gradients, serif display over sans body with a mono voice for labels and figures.
Restraint is the whole aesthetic -- the typography carries it, so nothing else has to shout.
THEME-AWARE BOTH WAYS: `prefers-color-scheme: dark` is the default signal, and :root[data-theme='dark'|
'light'] overrides win in BOTH directions, so an explicit toggle beats the OS rather than fighting it.
ALL markup here uses SINGLE-quoted attributes and CSS strings on purpose. It keeps every emitted literal
free of backslash escaping, and -- the real reason -- it means this stylesheet can never be routed through
nw_render: that substituter treats `{` as a binding opener, so a CSS rule body would be parsed as a lookup
key and SILENTLY DROPPED. Design systems are emitted RAW; only untrusted data goes through ed_esc.
Rule 12 at the boundary: ed_raw is for trusted template text, ed_esc for anything a person or a fetched
page supplied. The two are deliberately different function names so a reviewer can see which is which.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 3 importers
imports: nx_ad_serve.nxnx_syscalls.nx
imported by: nx_meal_page.nxnx_meal_skills_page.nxnx_site_build.nx
structs
| none |
consts
| 23 | const ED_TAB: i64 = 9 |
functions
| 25 | func ed_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 31 | func ed_empty() -> *u8 |
| 39 | func ed_raw(out: *u8, off: i64, s: *u8) -> i64 { return as_append(out, off, s) } called by 40: mpg_h1mpg_credit_sourcempg_credit_sponsormpg_ingredientmpg_rendermsp_mins+34 calls 1: as_append |
| 42 | func ed_esc(out: *u8, off: i64, s: *u8) -> i64 { return as_append_escaped(out, off, s, ed_len(s)) } called by 27: mpg_h1mpg_credit_sourcempg_credit_sponsormpg_ingredientmpg_rendermsp_step+21 calls 2: as_append_escapeded_len |
| 44 | func ed_num(out: *u8, off: i64, v: i64) -> i64 called by 8: mpg_credit_sourcempg_ingredientmpg_rendermsp_minsmsp_stepmsp_sources+2 calls 1: sys_mmap |
| 58 | func ed_money(out: *u8, off: i64, cents: i64) -> i64 |
| 74 | func ed_tokens_light(out: *u8, off: i64) -> i64 |
| 89 | func ed_tokens_dark(out: *u8, off: i64) -> i64 |
| 102 | func ed_css(out: *u8, off: i64) -> i64 |
| 260 | func ed_doc_open(out: *u8, off: i64, title: *u8) -> i64 |
| 275 | func ed_doc_close(out: *u8, off: i64) -> i64 |
| 280 | func ed_sec_open(out: *u8, off: i64, num: *u8, heading: *u8) -> i64 |
| 289 | func ed_sec_close(out: *u8, off: i64) -> i64 { return ed_raw(out, off, "</section>" as *u8) } |
| 292 | func ed_note(out: *u8, off: i64, kind: *u8, label: *u8, body: *u8) -> i64 |
| 305 | func ed_math_row(out: *u8, off: i64, label: *u8, cents: i64, total: i64, save: i64) -> i64 |
| 320 | func ed_math_text(out: *u8, off: i64, label: *u8, value: *u8, total: i64) -> i64 |
| 332 | func ed_tag(out: *u8, off: i64, cls: *u8, text: *u8) -> i64 |
| 351 | func ed_firm_css(out: *u8, off: i64) -> i64 |
| 411 | func ed_paper_css(out: *u8, off: i64) -> i64 |
| 430 | func ed_firm_nav_open(out: *u8, off: i64, wordmark: *u8, href: *u8) -> i64 |
| 438 | func ed_firm_nav_item(out: *u8, off: i64, label: *u8, href: *u8, current: i64) -> i64 |
| 446 | func ed_firm_nav_close(out: *u8, off: i64) -> i64 { return ed_raw(out, off, "</nav>" as *u8) } |
| 454 | func ed_firm_mast_open(out: *u8, off: i64, eyebrow: *u8, h1: *u8, h1_em: *u8, thesis: *u8, cta1: *u8, cta1href: *u8, cta2: *u8, cta2href: *u8, hint: *u8) -> i64 |
| 479 | func ed_firm_mast_close(out: *u8, off: i64) -> i64 { return ed_raw(out, off, "</div></header>" as *u8) } |
| 486 | func ed_art(out: *u8, off: i64, kind: i64) -> i64 |
| 499 | func ed_artpanel(out: *u8, off: i64, kind: i64, label: *u8) -> i64 |
| 508 | func ed_firm_search(out: *u8, off: i64, action: *u8, placeholder: *u8, label: *u8) -> i64 |
| 520 | func ed_cell_open(out: *u8, off: i64, tier: *u8, name: *u8, note: *u8, href: *u8) -> i64 |
| 534 | func ed_subs_open(out: *u8, off: i64) -> i64 { return ed_raw(out, off, "<ul class='subs'>" as *u8) } |
| 535 | func ed_subs_close(out: *u8, off: i64) -> i64 { return ed_raw(out, off, "</ul>" as *u8) } |
| 536 | func ed_sub(out: *u8, off: i64, label: *u8, href: *u8) -> i64 |
| 543 | func ed_cell_close(out: *u8, off: i64, go: *u8, href: *u8) -> i64 |
| 552 | func ed_person(out: *u8, off: i64, name: *u8, role: *u8, bio: *u8, mono: *u8, pending: i64) -> i64 |
| 568 | func ed_consult(out: *u8, off: i64, phone: *u8, email: *u8, addr: *u8, hours: *u8, action: *u8, back: *u8, submit: *u8, note: *u8) -> i64 |
| 599 | func ed_ctabar(out: *u8, off: i64, title: *u8, line: *u8, cta: *u8, ctahref: *u8, phone: *u8) -> i64 |