Markdown example: menubar with File/About menus and a theme switch

Markdown example: menubar with File/About menus and a theme switch

#8 in Riparion/riparion-editor — merged 2026-06-04

Summary

  • Restructures the markdown demo into examples/markdown/ and installs three dx catalog widgets into it (dx components add --module-path examples/markdown/components menubar alert_dialog switch), keeping the library's own dependency surface unchanged (dioxus-primitives is dev-only)
  • File ▸ Newalert_dialog confirmation ("unsaved changes will be lost"), then clears the editor
  • File ▸ Save — downloads the current Markdown source as document.md (Blob + object-URL anchor click via document::eval)
  • About — informational alert_dialog
  • Theme switch at the menubar's right edge toggles light/dark: it sets <html data-theme> (the attribute dx-components-theme.css keys its --light/--dark space toggles off), and the demo's own styles now use the same var(--light, X) var(--dark, Y) pattern so the whole page follows the switch — this also fixes black-on-black menu text for dark-mode-OS users

Test plan

  • cargo check --example markdown --features web
  • check_rsx lint clean
  • dx serve --example markdown --features web: File ▸ New shows confirm dialog and clears; File ▸ Save downloads document.md; About shows dialog; switch flips the whole page light/dark

🤖 Generated with Claude Code

Last updated 2026-06-05