gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit97110ad997110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre97110ad9/components/elements.hl

6.7 KB

  1. // components/elements.hl — `/elements`: every plain element the theme styles, with mock content: text, links, buttons,
  2. // fields, foldables, a drop zone, a table, pills and type colours, empty states and an overlong title.
  3. parent './main.hl'
  4. import SiteHeader from './site-header.hl'
  5. import SiteSidebar from './site-sidebar.hl'
  6. import ContentFirst from '../theme/shell/content-first.hl'
  7. __title = 'Elements · WorldAPI layouts'
  8. String dropped = 'Nothing dropped yet.'
  9. Style {
  10. elementsPage {
  11. section {
  12. marginBottom = '2.5rem'
  13. form {
  14. display = 'grid'
  15. gap = '1rem'
  16. maxWidth = '32rem'
  17. p { margin = '0' }
  18. }
  19. }
  20. fieldset {
  21. label {
  22. display = 'inline-flex'
  23. alignItems = 'center'
  24. gap = '.4rem'
  25. marginRight = '1rem'
  26. fontWeight = '400'
  27. color = 'var(--color-text)'
  28. }
  29. }
  30. }
  31. // Keep the ancestor compound: Style.pRow loses elements-page (probe v03).
  32. // Class rule would lose its ancestor or has no View reference (probe v03; hybriel#243).
  33. 'elements-page p.row' {
  34. display = 'flex'
  35. flexWrap = 'wrap'
  36. alignItems = 'center'
  37. gap = '.5rem'
  38. }
  39. // Keep the attribute/:not selector list: no nested form (probes v05/v11/v12).
  40. // No nested form for this functional/popup pseudo on day44 (v08/v11).
  41. 'elements-page section input:not([type="checkbox"]):not([type="radio"]),
  42. elements-page section select' { width = '100%' }
  43. }
  44. View {
  45. elementsPage {
  46. SiteHeader { current = "/elements" }
  47. ContentFirst {
  48. SiteSidebar { current = "/elements" }
  49. main {
  50. h1 { "Elements" }
  51. p { class = "muted" "Plain HTML, themed. No frames: a border appears only where it means something — the foldable and the drop zone below, and the focus ring." }
  52. section {
  53. h2 { "Text" }
  54. p { "Body text is light on dark. " strong { "Strong text and titles are white." } " Links take the accent: " a { href = "/elements" "a link to this page" } ". Inline " code { "code" } ", a key " kbd { "Ctrl" } " and " small { "small print" } "." }
  55. p { class = "muted" "Muted text says something secondary: updated 3 minutes ago." }
  56. h3 { "A third-level title" }
  57. ul { li { "First point" } li { "Second point, with a longer text that wraps onto the next line on a phone to show the indent of the list" } li { "Third point" } }
  58. pre { code { "inherit './theme/theme.hl'" } }
  59. }
  60. section {
  61. h2 { "Buttons" }
  62. p { class = "row"
  63. button { type = "button" class = "primary" "Save" }
  64. button { type = "button" "Cancel" }
  65. button { type = "button" class = "danger" "Delete" }
  66. button { type = "button" disabled = "disabled" "Disabled" }
  67. a { class = "button" href = "/elements" "A link as a button" }
  68. }
  69. p { class = "muted" "Quiet by default; the accent marks the one main action; danger says it destroys something." }
  70. }
  71. section {
  72. h2 { "Fields" }
  73. form { method = "get" action = "/elements"
  74. p { label { 'for' = "el-title" "Title" } input { id = "el-title" type = "text" name = "title" placeholder = "A title" } }
  75. p { label { 'for' = "el-mail" "E-mail (invalid)" } input { id = "el-mail" type = "email" name = "mail" value = "not an address" 'aria-invalid' = "true" } }
  76. p { label { 'for' = "el-kind" "Kind" } select { id = "el-kind" name = "kind" option { "Series" } option { "Movie" } option { "Show" } } }
  77. p { label { 'for' = "el-notes" "Notes" } textarea { id = "el-notes" name = "notes" placeholder = "Write…" } }
  78. fieldset {
  79. legend { "Show" }
  80. label { input { type = "checkbox" name = "watched" checked = "checked" } "Watched" }
  81. label { input { type = "radio" name = "order" value = "new" checked = "checked" } "Newest first" }
  82. label { input { type = "radio" name = "order" value = "old" } "Oldest first" }
  83. }
  84. p { button { type = "submit" "Send" } }
  85. }
  86. }
  87. section {
  88. h2 { "Foldables" }
  89. p { class = "muted" "The border is part of the foldable, like the tracker's seasons." }
  90. details { open = "open"
  91. summary { "Season 2 · 8 episodes" }
  92. ol { li { "The Fall" } li { "Lamia" } li { "Feral" } }
  93. }
  94. details {
  95. summary { "Season 1 · 10 episodes" }
  96. p { "Folded until opened." }
  97. }
  98. }
  99. section {
  100. h2 { "Drop zone" }
  101. dropZone { id = "el-drop" on dragover(e) { emit elDragOver(e) } on dragleave(e) { emit elDragLeave(e) } on drop(e) { emit elDrop(e) }
  102. "Drop a file here"
  103. }
  104. p { class = "muted" output { id = "el-dropped" dropped } }
  105. }
  106. section {
  107. h2 { "Table" }
  108. table {
  109. thead { tr { th { "Title" } th { "Type" } th { "Next" } } }
  110. tbody {
  111. tr { td { "Reacher" } td { span { class = "pill type-2" "Series" } } td { "S03E08" } }
  112. tr { td { "Dune: Part Two" } td { span { class = "pill type-1" "Movie" } } td { class = "muted" "watched" } }
  113. tr { td { "Late Night with the Devil" } td { span { class = "pill type-1" "Movie" } } td { "—" } }
  114. tr { td { "Taskmaster" } td { span { class = "pill type-3" "Show" } } td { "S18E02" } }
  115. }
  116. }
  117. }
  118. section {
  119. h2 { "Type colours and pills" }
  120. p { class = "muted" "Six slots an app names (the tracker: 1 Movie, 2 Series, 3 Show, 4 Genre, 5 Person). A pill is inverted: text on the colour." }
  121. p { class = "row"
  122. span { class = "pill type-1" "Movie" } span { class = "pill type-2" "Series" } span { class = "pill type-3" "Show" }
  123. span { class = "pill type-4" "Genre" } span { class = "pill type-5" "Person" } span { class = "pill type-6" "Type 6" }
  124. }
  125. p { class = "row"
  126. a { class = "type-1" href = "/elements" "Dune: Part Two" } a { class = "type-2" href = "/elements" "Reacher" } a { class = "type-3" href = "/elements" "Taskmaster" }
  127. a { class = "type-4" href = "/elements" "Science Fiction" } a { class = "type-5" href = "/elements" "Alan Ritchson" }
  128. }
  129. p { class = "row"
  130. span { class = "pill" "Accent" } span { class = "pill success" "Running" } span { class = "pill warning" "Paused" } span { class = "pill danger" "Ended" } span { class = "pill quiet" "Unknown" }
  131. }
  132. }
  133. section {
  134. h2 { "Empty state and an overlong title" }
  135. p { class = "empty" "No notes yet." }
  136. h3 { "Averyveryverylongtitlewithoutanyspacethatmustnotpushthepagesidewaysonaphone and then some more words to wrap" }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. on elDragOver(e) {
  143. e.preventDefault()
  144. e.currentTarget.classList.add('over')
  145. }
  146. on elDragLeave(e) { e.currentTarget.classList.remove('over') }
  147. on elDrop(e) {
  148. e.preventDefault()
  149. e.currentTarget.classList.remove('over')
  150. files = e.dataTransfer.files
  151. dropped = files.length > 0 ? 'Dropped: ' + files[0].name + ' (kept nowhere — a showcase)' : 'Dropped something without a file.'
  152. }

Branches

Latest commits

  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre
  • 494d75d4Nest caller slot styles in app-sidebarmre
  • e5571680Align all plugin sources with Hybriel day38bmre
  • 5d204c46Re-vendor layouts to Hybriel set day38bmre
  • 17e0f03eNest html-prefixed theme component overridesmre
  • e54e735eFormat plain theme elements with nested rules and bare mediamre
  • 547f834eRecord LY7 deployment and live verificationmre
  • fa4600b1Link caller-slot style exceptions to hybriel#270mre
  • 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