Expand description
Proc macros for Maud views with component-scoped helpers and runtime assets.
Supported workflows:
js!,css!, andcomponent!for file-scoped componentsinline_js!,inline_css!,js_file!, andcss_file!for direct asset injectionsurreal_scope_inline!()for the bundledsurreal.jsandcss-scope-inline.jssignals_inline!()andsurreal_scope_signals_inline!()for bundled Signals helpersfont_face!andfont_faces!for embedding font files as data URLs
Support policy:
- MSRV: Rust 1.85
- Supported Maud version: 0.27
Important limits:
component!accepts exactly one top-level Maud element with a body block. It doesn’t accept control-flow roots or every possible Maud token pattern.inline_js!parses the emitted JavaScript with SWC before generating markup.inline_css!performs a lightweight syntax check before forwarding the stylesheet as written.- Signals support stays JS-first: markup provides anchors, while
js!owns signals and DOM binding. - Slot helpers live in the companion
maud-extensions-runtimecrate.
Macros§
- component
- Wraps a single top-level Maud element and injects the local
js!andcss!helpers inside that root element. - css
- Generates a local CSS helper for Maud markup.
- css_
file - Emits a
<style>tag from a file path accepted byinclude_str!. - font_
face - Embeds a font file as a single
@font-faceblock. - font_
faces - Embeds multiple font files as adjacent
@font-faceblocks. - inline_
css - Emits a
<style>tag directly from a CSS string literal or token block. - inline_
js - Emits a
<script>tag directly from a JavaScript string literal or token block. - js
- Generates a local
fn js() -> maud::Markuphelper forcomponent!. - js_file
- Emits a
<script>tag from a file path accepted byinclude_str!. - signals_
inline - Emits the bundled Signals core runtime plus the Maud adapter helpers.
- surreal_
scope_ inline - Emits the bundled
surreal.jsandcss-scope-inline.jsruntime helpers. - surreal_
scope_ signals_ inline - Emits the bundled
surreal.js,css-scope-inline.js, Signals core, and Maud Signals adapter.
Derive Macros§
- Component
Builder - Derives a typed builder for a named component struct.