layouts
All repositories: gitoria
2.5 KB
// components/demo/notes-demo.hl — `/shells/list-first[/:id]`: SHELL 2 as a mock Notes app, signed in. On the phone `/`// shows only the list (its welcome text is never seen there); a note's route shows only the note, with a link back.// Desktop: list and note side by side; `/` shows the welcome text beside the list.parent '../main.hl'import AppHeader from '../../theme/shell/app-header.hl'import UserMenu from '../../theme/shell/user-menu.hl'import ListFirst from '../../theme/shell/list-first.hl'import { notes } from '../../lib/mock.hl'id = nullString view = id == null ? 'list' : 'detail'Hybrid rows = listRows(id)Hybrid note = noteOf(id)Boolean hasNote = id != nullBoolean welcome = id == nullBoolean emptyNote = note.paragraphs.length == 0__title = 'List-first demo · WorldAPI layouts'// the list with the opened note markedlistRows(at) {out = []for (n of notes) { out.push({ href = '/shells/list-first/' + n.id title = n.title updated = n.updated cls = n.id == at ? 'selected' : '' aria = n.id == at ? 'page' : 'false' }) }return out}noteOf(at) {for (n of notes) { if (n.id == at) { return n } }return { id = '' title = '' updated = '' paragraphs = [] }}Style {// The note fields retain their shared demo-root selectors.notesDemo {noteTitle {display = 'block'fontWeight = '600'color = 'var(--color-text-strong)'}noteUpdated {display = 'block'fontSize = '.85rem'color = 'var(--color-text-muted)'}noteFilter {display = 'block'padding = '.25rem .75rem .75rem'}}}View {notesDemo {AppHeader { brand = "Notes (demo)" brandHref = "/shells/list-first"UserMenu { name = "Signed in as az5b2 (mock)"a { href = "/shells" "Settings" }a { href = "/shells" "Logout" }}}ListFirst { view = viewaside { 'aria-label' = "Notes"noteFilter { input { type = "search" placeholder = "Filter notes" 'aria-label' = "Filter notes" } }ul { for (r of rows) { li { a { href = r.href class = r.cls 'aria-current' = r.aria noteTitle { r.title } noteUpdated { r.updated } } } } }}main {if (welcome) {h1 { "Notes" }p { class = "muted" "Pick a note on the left. (A phone never shows this text: it opens on the list.)" }p { class = "links" a { href = "/shells" "‹ Shells" } }}if (hasNote) {a { class = "back" href = "/shells/list-first" "All notes" }h1 { note.title }p { class = "muted" "Updated " note.updated }article { for (t of note.paragraphs) { p { t } } }if (emptyNote) { p { class = "empty" "This note is empty." } }}}}}}
Branches
Latest commits
- 413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre
- b810453etracker-demo: nest child and compound selectors in Stylemre
- 0b5b1d61notes-demo: nest child and compound selectors in Stylemre
- ab22bdc2mail-demo: nest child and compound selectors in Stylemre
- fe2d8de9home: nest child and compound selectors in Stylemre
- e631791buser-menu: nest child and compound selectors in Stylemre
- 69604944three-pane: nest child and compound selectors in Stylemre
- 3e389b83main-menu: nest child and compound selectors in Stylemre
- 05413975list-first: nest child and compound selectors in Stylemre
- c545b642content-first: nest child and compound selectors in Stylemre
- eae2be7aapp-sidebar: nest child selectors and document caller-slot gapmre
- 69c9f784Record LY7 slot nesting blocker and minimal repromre
- b1d4f379app-header: nest child and compound selectors in Stylemre
- 6385ff8eRecord LY7 style formatting proof and review statusmre
- 0100f51etracker-demo: format Style with nested rules and bare mediamre
- 5f82554enotes-demo: format Style with nested rules and bare mediamre
- 3dc27d78mail-demo: format Style with nested rules and bare mediamre
- cf9648afhome: format Style with nested rules and bare mediamre
- 846a6242user-menu: format Style with nested rules and bare mediamre
- 4d58708cthree-pane: format Style with nested rules and bare mediamre