Skip to content

Theme-authoring DX: tighten the edit loop (theme build --watch, a theme preview/gallery, earlier discoverability of astryx component/docs) #3375

Closed

Description

@josephfarina

Summary

Authored a custom defineTheme theme for a real Next 15 app. The theming model is genuinely great — mostly-pure components driven entirely by a theme. But the authoring loop is slow enough to be the main drag on iteration speed. These are focused DX requests for the theme-building workflow specifically (distinct from the integration traps in #3374; type/build bugs in #3371, #3373).

Versions: @astryxdesign/[email protected], @astryxdesign/[email protected]

Requests, roughly by impact:

1. astryx theme build --watch (biggest win)

Today theme build only takes --out. Every single tweak to the defineTheme file requires manually re-running:

npx astryx theme build theme.ts --out theme.css

Forget it once and you're debugging stale CSS that has nothing to do with your change. A --watch mode (rebuild on save) would turn theming into a real tight loop instead of edit → switch to terminal → rerun → refresh.

2. A theme preview / gallery command

There's no way to see your theme applied across components without wiring up your own page. The theme subcommands are only build / list / add. A command that renders all components (every variant/size/state) against your theme — a generated showcase page — would make it possible to eyeball a theme holistically and catch misses fast. (Design kits commonly ship exactly this as a showcase.html; it's invaluable while tuning tokens.)

3. Surface astryx component <Name> and astryx docs earlier (discoverability)

Most of my "how do I theme X?" time was spent not knowing the answer already existed in the CLI:

  • astryx component Button documents the themeable slots (the variant:/size: override keys, data-variant/data-size, the "Override in defineTheme" section, and themeable CSS vars).
  • astryx docs tokens lists the full token namespace.

These are excellent but nothing in the getting-started / theme add scaffold flow points you to them, so it's easy to guess at limitations that don't exist (I wrongly concluded a custom button variant needed a swizzle, when it's a documented theme feature). A one-line pointer in scaffold output and docs would fix most of the learning-curve pain.

4. Papercut: theme overrides fight the theme's own generated rules

To make display headings land I had to set explicit fontSize/lineHeight/letterSpacing in the heading/text overrides purely to out-specify Astryx's generated .level-N rules. Authors shouldn't have to reason about specificity within the generated theme output; setting the relevant token/type override should just win.

5. Clearer defineTheme type errors

Constraints like "typography weights must be strings", "lineHeight/fontWeight must be strings", and "url isn't allowed on a typography role" are reasonable, but the resulting type errors aren't self-explanatory. A couple of annotated examples in the theme docs (and/or friendlier messages) would smooth first-time authoring.

Net

Item 1 (--watch) and item 2 (preview) alone would dramatically speed up theme iteration; item 3 removes most of the learning-curve friction. Happy to help test any of these.

Activity

  1. self-assigned this
    on Jul 2, 2026
  2. added
    enhancement
    on Jul 2, 2026
  3. added a commit that references this issue on Jul 3, 2026
    1e20d0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions