Download this file
| 1 | {{/* estilo-menu-item: one row in any estilo-menu. Data: menu.Item, with |
| 2 | exactly one of Href (a link), Action (a one-button POST form) or |
| 3 | Dialog (a button opening the <dialog> with that id through the |
| 4 | platform's invoker command). All three work with scripts off; chrome.js |
| 5 | only adds the dialog for engines without invoker commands. Callers |
| 6 | supply the label in their own locale; Key is an already-formatted |
| 7 | shortcut (menu.Shortcut). Danger marks a destructive row |
| 8 | (estilo-menu-item="danger"), drawn in the negative tone. */}} |
| 9 | {{define "estilo-menu-item"}}{{if .Action}}<form method="post" action="{{.Action}}"><button estilo-menu-item{{if .Danger}}="danger"{{end}} type="submit">{{template "estilo-menu-item-body" .}}</button></form>{{else if .Dialog}}<button estilo-menu-item{{if .Danger}}="danger"{{end}} type="button" commandfor="{{.Dialog}}" command="show-modal">{{template "estilo-menu-item-body" .}}</button>{{else}}<a estilo-menu-item{{if .Danger}}="danger"{{end}} href="{{.Href}}">{{template "estilo-menu-item-body" .}}</a>{{end}}{{end}} |
| 10 | {{define "estilo-menu-item-body"}}<span estilo-menu-label>{{.Label}}</span>{{with .Key}}<kbd estilo-menu-key>{{.}}</kbd>{{end}}{{end}} |
| 11 | {{/* estilo-icon-check: the glyph inside an estilo-menu-check column. |
| 12 | Lucide "check" (ISC, brand/LICENSE.lucide). */}} |
| 13 | {{define "estilo-icon-check"}}<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"/></svg>{{end}} |
| 14 | |