Problem
Shared component templates compile with missing native style translations, so common controls do not retain their intended spacing, shape, and presentation.
Audited at v0.2.546, commit 0013ce66e3.
Reproduced evidence
Compiling actual shared-library components reports unknown-class diagnostics for:
- Button: rounded-control, shadow-md, transition-all, duration-200.
- TextInput/Select: rounded-control, px-control-x, py-control-y, text-control, ring utilities, shadow-sm.
- Card: rounded-panel.
- Drawer/Tooltip: positioning, stacking, overflow, shadow, and transition utilities.
Not every browser utility needs a literal native equivalent: cursor styles and hover-specific behavior may need deliberate alternatives. The functional layout and theme tokens are the first priority.
Sources:
Requested change
Inventory utilities used by shared components and prioritize design-token sizing, spacing, radii, borders/rings, shadows, and essential overlay positioning. Define explicit fallbacks or diagnostics where the host cannot represent a feature. Include runtime-computed classes, not only static markup.
Acceptance
- Representative shared controls retain expected spacing and shape.
- Theme/density tokens and appearance changes work across targets.
- Dynamic class/style updates are covered.
- Unsupported meaningful styles remain visible in diagnostics.
- Validate representative screens with maintained native hosts; IR assertions alone do not establish visual parity.
Priority
Fifth in the portability audit sequence. Token support can be developed in parallel with behavioral fixes; overlay styling should follow the presentation contract. The audit verified compiler diagnostics, not pixel-level device output.
Related audit issues
- fix(native): make shared component reactive props and emitted events host-independent: https://github.com/stacksjs/stx/issues/2086
- fix(native): preserve interactive label children and translate input types correctly: https://github.com/stacksjs/stx/issues/2087
- feat(native): make shared Form submission, values, and validation portable: https://github.com/stacksjs/stx/issues/2088
- feat(native): adapt shared overlays, tabs, and tooltips to host capabilities: https://github.com/stacksjs/stx/issues/2089