layouts
All repositories: gitoria
3.2 KB
// components/demo/tracker-demo.hl — `/shells/content-first[/:kind]`: SHELL 1 as a mock tracker, signed out. The header has// the main menu (Series | Shows | Movies | Genres | People) on desktop; on the phone it lives in a phone-only sidebar the// toggle opens. The content is the centred column the header's contents are flush with. `kind` filters the mock titles.parent '../main.hl'import AppHeader from '../../theme/shell/app-header.hl'import MainMenu from '../../theme/shell/main-menu.hl'import Sidebar from '../../theme/shell/app-sidebar.hl'import ContentFirst from '../../theme/shell/content-first.hl'import { titles } from '../../lib/mock.hl'static menu = [{ label = 'Series' href = '/shells/content-first/series' }{ label = 'Shows' href = '/shells/content-first/show' count = 12 }{ label = 'Movies' href = '/shells/content-first/movie' }{ label = 'Genres' href = '/shells/content-first/genre' }{ label = 'People' href = '/shells/content-first/person' }]kind = null// the all-titles page has no path of a menu item: the host says Series is the current one (item.current)Hybrid items = flag(menu, kind)String current = kind == null ? '/shells/content-first' : '/shells/content-first/' + kind // MainMenu gets no `current`: it marks the page from the route (hybriel#197)String heading = kind == null ? 'Everything' : kind.slice(0, 1).toUpperCase() + kind.slice(1)Hybrid shown = pick(kind)__title = 'Content-first demo · WorldAPI layouts'flag(list, k) {out = []for (m of list) { out.push({ label = m.label href = m.href count = m.count current = k == null && m.label == 'Series' }) }return out}pick(k) {out = []for (t of titles) {if (k == null || t.kind.toLowerCase() == k) { out.push({ title = t.title kind = t.kind type = t.type pill = 'pill ' + t.type next = t.next }) }}return out}Style {trackerDemo {// No language form for the existing class or attribute compound.'ul.titles' {display = 'grid'gap = '.25rem'margin = '0'padding = '0'listStyle = 'none'li {display = 'flex'flexWrap = 'wrap'alignItems = 'baseline'gap = '.25rem .75rem'margin = '0'padding = '.6rem 0'}a { fontWeight = '700' }// No language form for the existing class or attribute compound.'.next' {flexBasis = '100%'color = 'var(--color-text-muted)'fontSize = '.9rem'@media {minWidth = '40rem'flexBasis = 'auto'marginLeft = 'auto'}}}}}View {trackerDemo {AppHeader { brand = "Tracker (demo)" brandHref = "/shells/content-first" search = "/search" searchPlaceholder = "Search titles…"MainMenu { items = items }a { class = "button primary" href = "/shells" "Log in" }}ContentFirst {Sidebar { desktop = "false"MainMenu { items = items }}main {p { class = "links" a { href = "/shells" "‹ Shells" } }h1 { heading }p { class = "muted" "Content-first: the phone shows this content and slides the sidebar in from the header; desktop keeps the header's menu and this column, flush with each other. Signed out: a login where the user menu would be." }ul { class = "titles"for (t of shown) { li { a { class = t.type href = current t.title } span { class = t.pill t.kind } span { class = "next" t.next } } }}}}}}
Branches
Latest commits
- 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
- 0bbfc553main-menu: format Style with nested rules and bare mediamre
- 7755199dlist-first: format Style with nested rules and bare mediamre
- 35199303content-first: format Style with nested rules and bare mediamre
- 00f6e698app-sidebar: format Style with nested rules and bare mediamre
- bb2f29c9app-header: format Style with nested rules and bare mediamre