width, height, min-width, max-width, max-height and their logical aliases
take a percentage on Row, Column and Grid, as does min-height there, and
flex-basis takes one directly or through flex. The parser keeps the
percentage with a percent mask; Kryon layout resolves it against the
parent's content box. A percentage inside calc(), min(), max() or clamp(),
or on another widget's size, fails a plain native parse with the reason.
The pack format gains the style, flex and box masks (72 words a rule), the
committed style packs are regenerated, and the README table lists the new
values. Pins Kryon 60f081a4.
A plain CssSheetParse no longer skips a browser-only declaration
silently: it fails with a message that points shared sheets to
CssSheetParseWithDiagnostics, which keeps native rules and reports the
declaration. The web declaration counters on the parser and sheet are
gone; packs refuse such declarations through the same parse, and the
formatter counts them from the recorded declarations.
The README property table is generated by css_tool properties from the
parser's catalog, make check fails when it is stale, and the parse tests
read every catalog row natively on its target.
box-shadow selects an elevation role: none clears it, a shadow whose
largest blur is at most 8px is raised and a softer one floating. The
font shorthand sets style, weight, size and line height; its size is
one term so the slash starts the line height. A generic first family
keeps the theme face and monospace selects the code font role. The
diagnostics fixture uses text-transform as its browser-only example.
A rule can hold &:state, &.class, &#id and &[attribute] rules one level
deep. Each adds its parts to every parent selector, is read after the
parent yields, and exports with the parent's selector text. A part that
repeats a parent's class, id, attribute or state with another value is
an error. Combinators, :not() and child-position pseudo-classes stay
errors, now naming the native idiom, because native styles are matched
without tree context.
Lengths read through one expression reader. Without viewport units an
expression folds to pixels as the sheet is read, so box, size and flex
lengths take calc() and em too (em is the rule's own font-size, else
16px). With vw or vh it stays a clamp of linear forms the install
evaluates against the environment's viewport; packs carry them in an
exprs table, and CssSheetSameMedia reports a change when a new viewport
changes an active rule's length. A var() fallback may hold one more
var(), and var(--kryon-NAME) reads the installed theme palette.
margin (with auto), min-width, max-width, max-height, overflow and
text-align now compile to Kryon's StyleBoxData instead of passing to
the browser. Compiled packs use a single 69-word rule and 22-word
condition layout; a pack in an older layout is refused as stale, and
the five rule formats and the old condition format are gone. The
layout test checks centering, margins, clamps and clipping at 550 and
1200 px. Tests import kryon/Frame. Pins Kryon 28453c71.
Behavior tests for the parser, sheets, formatter, migrator and DOM
export; a conformance digest that C, C++, Go, ZX, Android and the
browser export must agree on; and a sanitized fuzzer. The export keeps
Kryon's rule ranking, HSL rounds as browsers round it, and the
migrator refuses output that would not parse.
Work in progress: the CSS parser, sheet, compiled packs, formatter,
migrator and DOM export replace the KSS reader. Tests and downstream
conversion follow.
A tab bar no longer looks like an outlined text field with a chip inside.
Material, Lightfield and Classic draw it as a row of labels over a soft
divider; the open tab keeps the text color and an accent underline, and
hovered tabs take a rounded fill.
KssStructuralMatch compared the name against eleven pseudo-classes in an
else-if chain; it is now `if name == { case "root"; ... case; }`.
Old and new versions agree on all 458,752 combinations of the fourteen
names tried (the eleven, an unknown one, "hover", and "") and the facts'
flags and small indexes, on C and on the portable runner. make check
passes on the pinned Ziran.
`ziran check --lint` found six casts that only widen a whole assigned
value (u8 to s32 or u32, float32 to float64). They are removed; the hex
digit arithmetic still happens on the byte before it widens. The
generated C of every KSS entry is identical before and after.
The lexer, parser, and formatter compared bytes with character codes
written as numbers (47, 42, 123, 58, ...). `ziran check --lint` found 226
such comparisons; they now read #char "/", #char "*", #char "{",
#char ":" and so on.
The change is textual only: the generated C of every KSS entry is
identical before and after, and `make test` passes with the pinned Ziran.
`ziran check --lint` found three casts that convert a value to the type
it already has: two cast(float64) on float64 parts of a number and one
cast(u8) on a byte. They are removed. `make test` still passes with the
pinned Ziran.
The byte classes the lexer reads, white space, digits, letters, hex
digits, and name and selector-name characters, were Bend laws over one
representative byte per class on Kryon's old runtime. They are now
Ziran laws proved for every byte, and `make test` checks them.
kryon/system_theme and kryon/theme resolve both in a --project build
and in an app's module-path build with --module-path kryon=DIR, so an
app that compiles KSS from source without the package map can use it.
KSS moves here from Kryon, with the classic, lightfield, and material
style packs, the pack module generator, and the parser tests and
sanitized fuzzing. Kryon keeps the rule table and style resolution;
apps that read .kss text add this package and import kss/Kss or
kss/SystemStyle.