42 Commits
Author SHA1 Message Date
waozi 20b7c95dbb Align CSS fixtures with native borrow lifetimes 2026-11-27 17:47:21 -03:00
waozi bf3a11671c Use public TSX fixtures and compile CSS checks once 2026-11-27 15:17:37 -03:00
waozi a0435853e8 Complete structural sibling selectors, flex units and gradient docs
Selectors: + and ~ match siblings already submitted in the same frame, restricted to a typed/class/id left side directly before the styled compound; chains and ancestor+sibling are refused with clear errors instead of silently mis-matching. The removed HTML DOM backend takes its DOM-browser tests with it. Flex: flex-basis accepts lengths (px, rem, em, vw, vh) and percentages of the measured flex row inner width; auto and content-based keywords stay browser-only until Kryon measures content sizes. Packs are regenerated, the properties README table and catalog output match the parser, and css_tool exposes the selector diagnostics.
2026-11-26 19:58:22 -03:00
waozi 074c039842 Complete radial-gradient parsing and paint the shared stops 2026-11-26 09:45:23 -03:00
waozi d9ee045e4d Add structural sibling selectors and pack the sheet for them 2026-11-26 08:52:32 -03:00
waozi 095874a1fd Build on Kryon 09664f07, whose programs declare main 2026-11-25 06:23:01 -03:00
waozi b60763223b Make translate the standard move and rename the part metric
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.
2026-11-23 04:44:46 -03:00
waozi eaba067d8c Name the native form for percentage radii, box-shadow through var() and pseudo-elements
From the trial's lower-frequency items: border-radius: 50% says that
999px rounds a pill (Kryon clamps a radius to half the shorter side), a
box-shadow written through var() says what native box-shadow takes, and
a pseudo-element says to draw the part as its own widget.
2026-11-23 04:31:45 -03:00
waozi 0b7e114367 Match HTML elements natively and say what Kryon does instead
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.
2026-11-23 04:10:53 -03:00
waozi 0ca5922573 Store compiled pack rules sparse
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.
2026-11-23 04:05:06 -03:00
waozi f748d90d94 Read transform, scale, rotate and transform-origin natively
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.
2026-11-23 03:08:06 -03:00
waozi 164d983c42 Name transform, scale and rotate as browser-only
transform, transform-origin, scale and rotate were unknown properties, so
a shared sheet using them failed even with diagnostics. They are now known
browser-only declarations: the DOM export keeps them, and a plain native
parse refuses them with the reason. Kryon paints a widget where layout puts
it; a paint-time transform needs a per-node offset in the tree and the paint
queue that does not exist yet.
2026-11-22 23:53:15 -03:00
waozi 7ff4ea1111 Read linear gradients at any angle with up to six stops
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.
2026-11-22 23:50:24 -03:00
waozi 79210326ef Read ancestor, parent, :first-child and :not() selectors natively
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.
2026-11-22 23:28:44 -03:00
waozi 8cc92b4e52 Read per-side borders and outline natively
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.
2026-11-22 23:17:16 -03:00
waozi b8c8eb3439 Read percentage sizes natively
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.
2026-11-22 22:46:12 -03:00
waozi 00d65fcb36 Refuse browser-only CSS natively and generate the property table
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.
2026-11-22 19:15:09 -03:00
waozi 161ca72c41 Map box-shadow, font and generic families to native roles
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.
2026-11-22 19:05:27 -03:00
waozi 48f2da629b Flatten nested & rules into compound selectors
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.
2026-11-22 19:00:19 -03:00
waozi 3effc75222 Resolve calc(), min(), max(), clamp(), em, vw and vh natively
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.
2026-11-22 18:54:17 -03:00
waozi d8044da394 Test painted, stretched and self-sizing containers; pin Kryon a04a3ba1
The layout pack now covers a content-sized card that paints its CSS box
beneath its child, a fixed-width column that stretches to its row, an
auto-width column that takes what the row left, flex: 1 taking a
column's remaining height, margin-left: auto, and Text sizing itself
where a container places it. The raster stub provides RasterTriangles
for the Text import.
2026-11-22 18:40:55 -03:00
waozi 82398790ca Lower CSS box properties to native layout and use one pack layout
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.
2026-11-22 17:32:59 -03:00
waozi 834f60cff8 Compile native flex styles and responsive layout packs 2026-11-22 16:32:02 -03:00
waozi e87bd75a45 Report recoverable and browser-only native CSS issues 2026-11-22 15:55:25 -03:00
waozi e2d73fcdd4 Export the native CSS style packs 2026-11-22 15:40:45 -03:00
waozi 7dd9fff21b Enable native viewport grids in CSS 2026-11-21 17:08:31 -03:00
waozi eba580e376 Compile native width and height for retained layouts 2026-11-20 12:19:41 -03:00
waozi 95fd8e09cb Compile native CSS transitions and keyframes 2026-11-20 01:52:45 -03:00
waozi 850bf7465c Resolve native CSS color mixes and reduced-motion queries 2026-11-20 01:07:50 -03:00
waozi ad4ec746bb Expand native CSS authoring and remove legacy KSS 2026-11-19 22:12:22 -03:00
waozi 89a0a8b174 Document Kryon CSS and run conformance in CI 2026-11-07 13:58:38 -03:00
waozi 240cf61ab6 Test the CSS subset on every backend
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.
2026-11-07 13:53:00 -03:00
waozi bc247a75de Parse Kryon styles as a CSS subset
Work in progress: the CSS parser, sheet, compiled packs, formatter,
migrator and DOM export replace the KSS reader. Tests and downstream
conversion follow.
2026-11-07 13:15:02 -03:00
waozi d208dc030f Align the Kryon package graph and retain C++ host validation 2026-11-02 04:37:45 -03:00
waozi 7646df8106 Use shared rule capacity for custom KSS sheets 2026-10-09 00:35:23 -03:00
waozi 8dfb075422 Support typed customization tokens and preserve rejected style snapshots 2026-10-09 00:14:04 -03:00
waozi 751df84d31 Preserve authored pixel units in CSS values 2026-10-07 18:38:44 -03:00
waozi 5dc6e6a76c Export portable KSS styles for native browser layout 2026-10-07 18:29:52 -03:00
waozi 3a90196f28 Check that formatting keeps form feeds and vertical tabs inside quotes
The fuzz check now ignores vertical tab and form feed as the lexer
does, so it cannot see them vanish from quoted text. This test formats
a sheet with both inside a quoted value and requires the formatter to
copy them through.
2026-09-29 21:35:11 -03:00
waozi ffbf8cffe5 Treat vertical tab and form feed as whitespace in the KSS fuzz check
The lexer skips them, so the formatter may drop them, but the fuzz check
counted that as a change beyond whitespace (Kryon CI, seed 1113). The
check now uses the lexer's KssIsSpace, and the sheet joins the corpus.
2026-09-29 21:27:02 -03:00
waozi 0cf25d6c00 Import Kryon's theme modules by their module names
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.
2026-09-29 21:03:15 -03:00
waozi 95387b23f5 Parse, format, and install KSS style sheets as a package over Kryon
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.
2026-09-29 20:56:55 -03:00