feat(dsl): self-contained, responsive screen layouts
#3 in tonybierman/dioxus-mcp — merged 2026-05-29
Summary
Screen layouts now carry their own structural CSS, so a saved/built-in layout reproduces structurally in any project regardless of CSS toolchain. This fixes the original problem where a layout saved from a non-Tailwind project (arium, which styles via hand-written app.css) could not be recreated elsewhere — the registry modeled a layout's markup but not its style dependency.
What changed
Carry CSS with a layout (dioxus-mcp-registry, generate/screen.rs)
LayoutDescriptorgainsstyles(raw CSS) andrequires(toolchain hint). Both serde-optional, so the wasm-safe registry crate is unaffected.generate_screenemits a layout'sstylestoassets/{snake}.csson scaffold (skip-if-exists, with adocument::Stylesheetmount hint), mirroring thevanilla-cssstarter path. A layout that declaresrequiresbut ships no styles gets a loud scaffold-time advisory instead of silent unstyled divs.
Re-capture admin_console and promote it to a built-in
- Recaptured arium's real
admin_console(semantic classes + the actualapp.cssrules, theme tokens kept asvar(--token, <neutral>)), then moved it from the machine-local global overlay into the built-in library so it ships compiled in and version-controlled.
Make the whole structural library self-contained
- All 12 remaining shells (holy_grail, bento, masonry, full_bleed, sticky_sidebar, mega_menu, drawer, card_grid, editorial, hero_scroll, split_screen, scroll_sticky) converted from Tailwind-utility markup to semantic classes + carried, responsive CSS. The entire library is now toolchain-independent — none declares
requires. - Mobile-first, 48rem breakpoint (card_grid also steps at 40/64rem;
draweris deliberately breakpoint-free — an off-canvas overlay is the same at every size). Shared neutral token vocabulary read viavar(--token, <fallback>).
Tests
every_library_layout_is_self_contained— every built-in carriesstyles, declares norequires, and (exceptdrawer) is responsive.every_library_layout_renders_a_valid_component— all 13 templates render valid component bodies.registry_layout_with_styles_emits_sibling_stylesheet— end-to-end CSS emission + mount hint.project_overlay_adds_and_overrides_by_id— astyles-bearing overlay descriptor survives the TOML round-trip.
Local cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace all pass. RSX validity of the rewritten templates was confirmed by rendering and inspection (not a full Dioxus cargo check).
See docs/layout-styles-plan.md for the full design write-up and known limitations.
🤖 Generated with Claude Code
Last updated 2026-05-29
Links to this note
Merged pull requests, newest first.