Commit Graph
213 Commits
Author SHA1 Message Date
waozi 5af50d6915 Rename classic style pack 2026-09-18 23:58:58 -03:00
waozi 0154a2f0a9 Clarify paused JavaScript target in docs 2026-09-18 23:25:30 -03:00
waozi 556ed7dbe6 Use shared KSS declarations for inline browser styles 2026-09-18 16:19:13 -03:00
waozi a41ad169e9 Share KSS declaration expansion across rules and keyframes 2026-09-18 16:05:30 -03:00
waozi e10e885f61 Move CSS property aliases and numeric unit policy into Kryon sources 2026-09-18 15:52:07 -03:00
waozi 7f13623156 Share KSS positional formula validation and CSS serialization 2026-09-18 15:39:58 -03:00
waozi c430658b34 Move structural and positional pseudo dispatch into shared Kryon policy 2026-09-18 14:53:58 -03:00
waozi d0df2b0a1b Share relative selector parsing and anchor has traversal in Kryon policy 2026-09-18 14:42:27 -03:00
waozi e2f93c547d Share selector chain traversal and backtrack ancestor and sibling alternatives 2026-09-18 14:26:48 -03:00
waozi ae59d26d05 Preserve repeated selector conditions and share identity matching 2026-09-18 14:13:14 -03:00
waozi 011b7f7f7a Preserve independent KSS selector groups with shared matching policy 2026-09-18 13:46:51 -03:00
waozi 16461b5bc6 Use shared KSS lexer for functional pseudo arguments 2026-09-18 13:37:52 -03:00
waozi da7ad7291b Generate declarative selector parsing from shared Kryon source 2026-09-18 13:28:24 -03:00
waozi 32d57370e7 Share selector state and structural rules in Kryon policy 2026-09-18 13:01:13 -03:00
waozi 3ce35bb3d1 Share KSS attribute and sibling-position predicates 2026-09-18 12:46:44 -03:00
waozi a51c90c73e Share cascade priorities and prevent layer score collisions 2026-09-18 12:31:17 -03:00
waozi 419476a1f1 Move CSS declaration semantics into shared KSS runtime 2026-09-18 12:19:18 -03:00
waozi 972bd5140a Share KSS environment policy and repair web verification gates 2026-09-18 11:58:54 -03:00
waozi 6b2d56d6cc Add SetStyleTheme and kryon-preview --theme for pack overlays
SetStyleTheme(light|dark|'') re-resolves every registered pack - built-in
embedded packs, source packs, and their declared variants - through the
shared parse environment's theme axis, preserving the active pack id so
frames repaint in place. The parser exports KssSetTheme beside
KssSetVariant, the C shim grows kss_parse_with_environment, built-ins
re-parse through ReapplyBuiltInStyleTheme, and kryon-preview --theme
applies it before --style so captures can combine any pack (including
'<pack>.<variant>') with either theme overlay. The pack-source test
covers overlay winner flips in both directions and active-pack
survival; every test linking the generated parser now links the
formatter module it references. Go and web keep theme selection at
parse time, with the Go registry's source-retaining counterpart
recorded as a follow-up.
2026-09-16 16:42:23 -03:00
waozi 990d650e81 Assert resolution parity from the shared matched fixture
The matched fixture now anchors the shared cascade across hosts: the C
suite resolves its rules through ResolveStyle and the Go suite through
the same generated resolver, asserting identical winners - the base
state including the dark-theme overlay winner, an imported token,
explicit zero with its presence bit, the contrast env axis field, the
pressed state, class matching, and an active variant rule plus overlay.
The web suite asserts the same winners through the CSS mapping. To make
variant rules win naturally, the fixture splits its glow declaration
into an overlay block before the rules that reference the token and a
rule block after the same-layer base Button, matching the documented
positional semantics now spelled out in the API notes.
2026-09-16 12:29:05 -03:00
waozi 800393ae80 Register declared KSS variants in the Go pack registry
The Go host mirrors the C flow: ParseStyleVariants reports a sheet's
'@variant' declarations with labels, ParseStyleSheetVariant parses with
one active, and RegisterStylePackSource registers each declaration as a
selectable '<pack>.<variant>' pack whose sheet re-resolves base and
variant rules together. The web layer keeps variant selection in the
parse environment since it has no pack registry. Documented in API.md;
end-to-end registration, activation, and resolution are covered by
TestStylePackDeclaredVariant.
2026-09-15 22:54:05 -03:00
waozi 36d6b19181 Add @variant pack options to the KSS grammar
'@variant name "Label" { token overlays and rules }' declares a
selectable pack option in the sheet itself, replacing the
color-substitution-only variant path as the home for treatments like
Lightfield's glow. The shared grammar records every declaration (name
and label) for host enumeration even when inactive; the parse
environment names the active variant (KssSetVariant in C and Go, the
environment's variant field on the web). An active variant contributes
rules in document order and applies token overlays at the variant
origin, above theme and environment and below scoped rules. As with
@theme and @env, overlays apply from their position onward.

RegisterStylePackSource registers each declared variant as a selectable
'<pack>.<variant>' pack carrying the declared label; activating it
re-parses the source with the variant active so base and variant rules
resolve together. The matched fixture grows a glow variant asserted in
C, Go, and web (enumeration, inactive skip, overlay precedence over the
dark theme, and rule ordering), and the pack-source test covers
registration, activation, and resolution end to end.
2026-09-15 22:35:57 -03:00
waozi 6dadfae89b Route the web KSS layer through the generated kry module
parseWebStyleSheet now runs runtime/kss_parser.kry in declarative mode: the shared grammar lexes rule selectors, declaration spans, and foreign blocks (@keyframes, @media, @supports, @container) and the web layer only maps them to CSS. Theme overlays, typed environment axes, imports with cycle and missing-source diagnostics, layer ordering, and file:line:column provenance now behave identically on the web, and the hand-written regex KSS parser is removed. Durations convert through exact decimal shifting and integer diagnostics printing avoids float division so C, Go, and JavaScript agree. Strict and CSS-superset web suites pass; the remaining k2js syntax failure is the pre-existing ruby text regression from 4d60fab5.
2026-09-15 18:38:13 -03:00
waozi e20ac9a273 Add cat turtle and moon avatars with stable icon catalog IDs 2026-09-15 18:20:49 -03:00
waozi 7bcd5d3905 Preserve visible opacity for surfaces without an explicit declaration 2026-09-15 15:44:44 -03:00
waozi 8467e21555 Remove Vanilla styling and keep Material as the default 2026-09-15 12:20:25 -03:00
waozi 93c132b79b Implement the KSS language once in runtime/kss_parser.kry
The KSS grammar now lives in a single strict .kry module that the shared transpilers lower to C, Go, and JavaScript. It implements @theme token overlays, typed @env axes with closed values, @import with depth-first ordering, cycle detection and missing-source errors, ordered @layer declarations, @version, per-rule file/line/column provenance, and per-token origin kinds. Token precedence is imports, pack tokens, active theme overlay, matching environment overrides, then programmatic variant colors. The hand-written C and Go parsers are replaced by thin host shims that provide native string slices and import module registration; the web runtime gains the shared byte-index and StringSlice helpers. Verified with the C style test suites, the full Go runtime suite, and the language spec contract executed through Go and JavaScript.
2026-09-15 12:12:23 -03:00
waozi 4d60fab509 Connect browser text editing and preserve IME ownership across redraws 2026-09-15 11:57:58 -03:00
waozi 1e6b28acb4 Keep only unfinished work in the style plan 2026-09-15 10:09:18 -03:00
waozi 16510c75cd Support style color variations without changing base packs 2026-09-15 09:48:24 -03:00
waozi 1a70bc982a Transform scroll clips and provide title bar back icons 2026-09-14 22:58:30 -03:00
waozi 7e26637a56 Support balanced pointer capture scopes for inert previews 2026-09-14 18:14:55 -03:00
waozi 09c059033b Remove stale text style names from public docs 2026-09-14 07:17:08 -03:00
waozi f68b792642 Remove UI prefixes from widget review surface 2026-09-14 07:14:48 -03:00
waozi f76aeff0af Fix generated runtime parity drift 2026-09-14 00:04:11 -03:00
waozi bed17dcbd1 Make raw text measurement helpers internal 2026-09-13 23:48:14 -03:00
waozi dc862e2f7d Make text baseline helper internal 2026-09-13 23:45:54 -03:00
waozi 3bf70ab932 Remove stale public icon size enum 2026-09-13 23:43:39 -03:00
waozi 13f5d99926 Move focus scope hooks out of public API 2026-09-13 20:58:08 -03:00
waozi 00ff02377b Move image tint to KSS 2026-09-13 06:08:14 -03:00
waozi f9ec974863 Remove text color prop 2026-09-13 05:54:54 -03:00
waozi 55695cdb5b Remove text font prop 2026-09-13 05:45:24 -03:00
waozi af3b3a9208 Remove text letter spacing prop 2026-09-13 05:38:50 -03:00
waozi 3e0220b2d8 Move page spacing to KSS 2026-09-13 05:12:17 -03:00
waozi 1ffd794573 Move navigation bar margins to KSS 2026-09-13 05:01:41 -03:00
waozi 80841c5f16 Move Text typeface selection to KSS 2026-09-13 04:57:29 -03:00
waozi 125fe13e5c Remove dropdown option font styling 2026-09-13 04:53:07 -03:00
waozi 5fe9eefc8b Move navigation bar icon styling to KSS 2026-09-13 04:45:20 -03:00
waozi 649a07e531 Clean Link props and DOM runtime inputs 2026-09-13 04:39:33 -03:00
waozi 24588a1679 Move text input and tab styling to KSS 2026-09-13 04:35:48 -03:00