gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitce4a0baece4a0baeKeep caller slot styles whole so minimal shell apps startmrece4a0bae/components/elements.hl

6.3 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. 'elements-page section' { marginBottom = '2.5rem' }
  11. 'elements-page p.row' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.5rem' }
  12. 'elements-page section form' { display = 'grid' gap = '1rem' maxWidth = '32rem' }
  13. 'elements-page section form p' { margin = '0' }
  14. 'elements-page section input:not([type="checkbox"]):not([type="radio"]),
  15. elements-page section select' { width = '100%' }
  16. 'elements-page fieldset label' { display = 'inline-flex' alignItems = 'center' gap = '.4rem' marginRight = '1rem' fontWeight = '400' color = 'var(--color-text)' }
  17. }
  18. View {
  19. elementsPage {
  20. SiteHeader { current = "/elements" }
  21. ContentFirst {
  22. SiteSidebar { current = "/elements" }
  23. main {
  24. h1 { "Elements" }
  25. 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." }
  26. section {
  27. h2 { "Text" }
  28. 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" } "." }
  29. p { class = "muted" "Muted text says something secondary: updated 3 minutes ago." }
  30. h3 { "A third-level title" }
  31. 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" } }
  32. pre { code { "inherit './theme/theme.hl'" } }
  33. }
  34. section {
  35. h2 { "Buttons" }
  36. p { class = "row"
  37. button { type = "button" class = "primary" "Save" }
  38. button { type = "button" "Cancel" }
  39. button { type = "button" class = "danger" "Delete" }
  40. button { type = "button" disabled = "disabled" "Disabled" }
  41. a { class = "button" href = "/elements" "A link as a button" }
  42. }
  43. p { class = "muted" "Quiet by default; the accent marks the one main action; danger says it destroys something." }
  44. }
  45. section {
  46. h2 { "Fields" }
  47. form { method = "get" action = "/elements"
  48. p { label { 'for' = "el-title" "Title" } input { id = "el-title" type = "text" name = "title" placeholder = "A title" } }
  49. p { label { 'for' = "el-mail" "E-mail (invalid)" } input { id = "el-mail" type = "email" name = "mail" value = "not an address" 'aria-invalid' = "true" } }
  50. p { label { 'for' = "el-kind" "Kind" } select { id = "el-kind" name = "kind" option { "Series" } option { "Movie" } option { "Show" } } }
  51. p { label { 'for' = "el-notes" "Notes" } textarea { id = "el-notes" name = "notes" placeholder = "Write…" } }
  52. fieldset {
  53. legend { "Show" }
  54. label { input { type = "checkbox" name = "watched" checked = "checked" } "Watched" }
  55. label { input { type = "radio" name = "order" value = "new" checked = "checked" } "Newest first" }
  56. label { input { type = "radio" name = "order" value = "old" } "Oldest first" }
  57. }
  58. p { button { type = "submit" "Send" } }
  59. }
  60. }
  61. section {
  62. h2 { "Foldables" }
  63. p { class = "muted" "The border is part of the foldable, like the tracker's seasons." }
  64. details { open = "open"
  65. summary { "Season 2 · 8 episodes" }
  66. ol { li { "The Fall" } li { "Lamia" } li { "Feral" } }
  67. }
  68. details {
  69. summary { "Season 1 · 10 episodes" }
  70. p { "Folded until opened." }
  71. }
  72. }
  73. section {
  74. h2 { "Drop zone" }
  75. dropZone { id = "el-drop" on dragover(e) { emit elDragOver(e) } on dragleave(e) { emit elDragLeave(e) } on drop(e) { emit elDrop(e) }
  76. "Drop a file here"
  77. }
  78. p { class = "muted" output { id = "el-dropped" dropped } }
  79. }
  80. section {
  81. h2 { "Table" }
  82. table {
  83. thead { tr { th { "Title" } th { "Type" } th { "Next" } } }
  84. tbody {
  85. tr { td { "Reacher" } td { span { class = "pill type-2" "Series" } } td { "S03E08" } }
  86. tr { td { "Dune: Part Two" } td { span { class = "pill type-1" "Movie" } } td { class = "muted" "watched" } }
  87. tr { td { "Late Night with the Devil" } td { span { class = "pill type-1" "Movie" } } td { "—" } }
  88. tr { td { "Taskmaster" } td { span { class = "pill type-3" "Show" } } td { "S18E02" } }
  89. }
  90. }
  91. }
  92. section {
  93. h2 { "Type colours and pills" }
  94. 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." }
  95. p { class = "row"
  96. span { class = "pill type-1" "Movie" } span { class = "pill type-2" "Series" } span { class = "pill type-3" "Show" }
  97. span { class = "pill type-4" "Genre" } span { class = "pill type-5" "Person" } span { class = "pill type-6" "Type 6" }
  98. }
  99. p { class = "row"
  100. a { class = "type-1" href = "/elements" "Dune: Part Two" } a { class = "type-2" href = "/elements" "Reacher" } a { class = "type-3" href = "/elements" "Taskmaster" }
  101. a { class = "type-4" href = "/elements" "Science Fiction" } a { class = "type-5" href = "/elements" "Alan Ritchson" }
  102. }
  103. p { class = "row"
  104. span { class = "pill" "Accent" } span { class = "pill success" "Running" } span { class = "pill warning" "Paused" } span { class = "pill danger" "Ended" } span { class = "pill quiet" "Unknown" }
  105. }
  106. }
  107. section {
  108. h2 { "Empty state and an overlong title" }
  109. p { class = "empty" "No notes yet." }
  110. h3 { "Averyveryverylongtitlewithoutanyspacethatmustnotpushthepagesidewaysonaphone and then some more words to wrap" }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. on elDragOver(e) {
  117. e.preventDefault()
  118. e.currentTarget.classList.add('over')
  119. }
  120. on elDragLeave(e) { e.currentTarget.classList.remove('over') }
  121. on elDrop(e) {
  122. e.preventDefault()
  123. e.currentTarget.classList.remove('over')
  124. files = e.dataTransfer.files
  125. dropped = files.length > 0 ? 'Dropped: ' + files[0].name + ' (kept nowhere — a showcase)' : 'Dropped something without a file.'
  126. }

Branches

Latest commits

  • 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
  • 69604944three-pane: nest child and compound selectors in Stylemre