// Package menu is the suite's one floating panel ([estilo-menu]), its // rows ([estilo-menu-item]) and the document menu bar // ([estilo-menubar]). Docs is its first consumer. // // Scripts off, a menu is a
: it opens, and its links and form // buttons work; it closes only when its summary is clicked again. Script // may add Escape, outside-click close and menubar hover-switching; none // of it is required. // // It carries no strings. Callers supply every label in their locale. package menu import ( "embed" "net/http" "strings" ) //go:embed menu.css var css []byte //go:embed templates/*.html var templateFS embed.FS // CSS returns menu.css. Link it after base.css and before chrome.css. func CSS() []byte { return append([]byte(nil), css...) } // Templates holds estilo-menu-item and estilo-icon-check. Parse it into // the app's page templates with ParseFS(Templates(), "templates/*.html"). func Templates() embed.FS { return templateFS } // Item is one row rendered by estilo-menu-item. Set exactly one of Href, // Action and Dialog; each is a different element, and each works with // scripts off: // // - Href: a link, , for a row that navigates. // - Action: a one-button
to that path, for a row // that changes something ("New sheet"). // - Dialog: a