gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite631791be631791buser-menu: nest child and compound selectors in Stylemree631791b/components/demo/tracker-demo.hl

3.2 KB

  1. // components/demo/tracker-demo.hl — `/shells/content-first[/:kind]`: SHELL 1 as a mock tracker, signed out. The header has
  2. // the main menu (Series | Shows | Movies | Genres | People) on desktop; on the phone it lives in a phone-only sidebar the
  3. // toggle opens. The content is the centred column the header's contents are flush with. `kind` filters the mock titles.
  4. parent '../main.hl'
  5. import AppHeader from '../../theme/shell/app-header.hl'
  6. import MainMenu from '../../theme/shell/main-menu.hl'
  7. import Sidebar from '../../theme/shell/app-sidebar.hl'
  8. import ContentFirst from '../../theme/shell/content-first.hl'
  9. import { titles } from '../../lib/mock.hl'
  10. static menu = [
  11. { label = 'Series' href = '/shells/content-first/series' }
  12. { label = 'Shows' href = '/shells/content-first/show' count = 12 }
  13. { label = 'Movies' href = '/shells/content-first/movie' }
  14. { label = 'Genres' href = '/shells/content-first/genre' }
  15. { label = 'People' href = '/shells/content-first/person' }
  16. ]
  17. kind = null
  18. // the all-titles page has no path of a menu item: the host says Series is the current one (item.current)
  19. Hybrid items = flag(menu, kind)
  20. String current = kind == null ? '/shells/content-first' : '/shells/content-first/' + kind // MainMenu gets no `current`: it marks the page from the route (hybriel#197)
  21. String heading = kind == null ? 'Everything' : kind.slice(0, 1).toUpperCase() + kind.slice(1)
  22. Hybrid shown = pick(kind)
  23. __title = 'Content-first demo · WorldAPI layouts'
  24. flag(list, k) {
  25. out = []
  26. for (m of list) { out.push({ label = m.label href = m.href count = m.count current = k == null && m.label == 'Series' }) }
  27. return out
  28. }
  29. pick(k) {
  30. out = []
  31. for (t of titles) {
  32. 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 }) }
  33. }
  34. return out
  35. }
  36. Style {
  37. trackerDemo {
  38. // No language form for the existing class or attribute compound.
  39. 'ul.titles' {
  40. display = 'grid'
  41. gap = '.25rem'
  42. margin = '0'
  43. padding = '0'
  44. listStyle = 'none'
  45. li {
  46. display = 'flex'
  47. flexWrap = 'wrap'
  48. alignItems = 'baseline'
  49. gap = '.25rem .75rem'
  50. margin = '0'
  51. padding = '.6rem 0'
  52. }
  53. a { fontWeight = '700' }
  54. // No language form for the existing class or attribute compound.
  55. '.next' {
  56. flexBasis = '100%'
  57. color = 'var(--color-text-muted)'
  58. fontSize = '.9rem'
  59. @media {
  60. minWidth = '40rem'
  61. flexBasis = 'auto'
  62. marginLeft = 'auto'
  63. }
  64. }
  65. }
  66. }
  67. }
  68. View {
  69. trackerDemo {
  70. AppHeader { brand = "Tracker (demo)" brandHref = "/shells/content-first" search = "/search" searchPlaceholder = "Search titles…"
  71. MainMenu { items = items }
  72. a { class = "button primary" href = "/shells" "Log in" }
  73. }
  74. ContentFirst {
  75. Sidebar { desktop = "false"
  76. MainMenu { items = items }
  77. }
  78. main {
  79. p { class = "links" a { href = "/shells" "‹ Shells" } }
  80. h1 { heading }
  81. 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." }
  82. ul { class = "titles"
  83. for (t of shown) { li { a { class = t.type href = current t.title } span { class = t.pill t.kind } span { class = "next" t.next } } }
  84. }
  85. }
  86. }
  87. }
  88. }

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