translate: x [y] is a transform property now: it moves the whole box at
paint time after rotate, scale and transform, through Kryon's paint
transform pass, and transition: translate eases it. The widget part
metric it used to set (a NavigationBar panel's width, a Modal panel, a
Segment's label padding) is -kryon-content-offset; the three presets
use it, and there is no alias. The pack format is 118 words a rule.
Tests: the classic pack keeps NavigationBar 340, Modal 420 and the
Segment label padding as content offsets with no visual translate, and
a :hover translate lifts a box by 2px and applies after rotate.
A usability trial ran five ordinary web stylesheets through css_tool
check. Its fifteen most frequent non-native features are handled here.
HTML type selectors that are one Kryon widget match it: a, p, button,
input, textarea, select, img and body. Headings, tables, label and plain
containers fail with their native form. Browser-only declarations and
common web properties without a native form (position and its offsets,
backdrop-filter, named grid areas, box-sizing, aspect-ratio, object-fit,
overflow-x/-y, place-items, appearance, float) say what Kryon does
instead, as do z-index, cursor, display: none and inline-*, unequal grid
tracks and percentage sizes inside min(). Two classes in one selector and
unequal block padding name the native form.
css_tool check exits with status 1 when it skipped anything natively and
stays at 0 for browser-only declarations alone.
Most of a rule's 116 words are zero. A pack now stores each rule as a
four-word mask of the words that are set, then only those words, and
CssSheetLoad unpacks them; CssPackRule writes the form for css_tool and
the tests. The Material pack the app starter loads shrinks its portable
bundle by 96,289 bytes (4,105,197 to 4,008,908). A pack carries
compiled.rule_count; one without it, or one that ends inside a rule, is
refused as stale.
transform takes translate(), scale() and rotate() and their X and Y forms
in any order that does not shear, kept as one translation, turn and x and
y scale; scale, rotate and transform-origin are read too, and a
transition that names transform (or all) sets how a change eases. They
are box fields Kryon's paint transform pass applies on every host.
Skew, matrix(), 3D functions, translate() percentages and shearing lists
fail a plain native parse with the reason; a shared sheet leaves them to
the browser.
Transforms are opt-in paint code in Kryon: CssSheetInstall refuses a
sheet that sets one until the app has called PaintTransformInstall(),
and says so. The browser-only transform message this replaces is gone.
The pack format is 116 words a rule. Pins Kryon fdd70c4b.
linear-gradient() in background and background-image takes an angle (deg,
turn, rad or grad) or to a side or corner, and two to six color stops with
optional percentage positions, which fill in as in CSS. Top to bottom with
two end stops stays the two-color face every widget paints; anything else
is a box gradient Row, Column and Grid paint, with the direction computed
here, while other widgets paint the first and last colors top to bottom and
css_tool check says so. Radial, conic and repeating gradients are refused
natively with the reason.
The pack format is 101 words a rule. Pins Kryon d0711324.
One ancestor compound, matched by its class or id, may come before the
styled compound: '.card Text' for any ancestor, '.card > Text' for the
parent. :first-child, :not(.class) and :not(:state) add tree context, also
in nested & rules, and the DOM export writes all of them as browser
selectors. :last-child, :nth-child(), typed or second ancestors and sibling
combinators fail with the native idiom.
The pack format is 87 words a rule. Pins Kryon 56777c65, which matches the
context while the frame builds.
border-top, border-right, border-bottom, border-left and the logical
block and inline sides, each with -width, -color and -style, become box
fields on Row, Column and Grid, var() values included; a uniform border
later in the same rule clears earlier sides. With a border radius a box
paints its uniform border, and css_tool check reports it. Border widths
take thin, medium and thick.
outline, outline-width and outline-offset size the native focus ring;
outline: none keeps it, which css_tool check says. The pack format is 82
words a rule and the README table lists the new properties. Pins Kryon
d97c19e8.
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.
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.