gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commita72b57cfa72b57cficons: nest Style rules in the language's formmrea72b57cf/components/styles.hl

5.1 KB

  1. // components/styles.hl — the SITE's own CSS (page layout: header, main, the home list), served as /__hl/app.css. Every component
  2. // carries its own Style in its file (components/*/*.hl). The site shows the library's BASE LOOK (ticket #15): black, white and the greys of
  3. // shared/base.hl — it declares none of the WorldAPI tokens (--color-…), so every component shows its own base fallbacks, as in a bare app.
  4. // Light: white page, black text; the header is the one black block. No frames. In a styles file a bare name is a TAG (camelCase → kebab), a quoted name is a
  5. // selector written verbatim. MOBILE FIRST: every rule is the phone's; the min-width block adds the wide layout.
  6. import { var } from 'hl:web/css'
  7. import { black, greyDark, grey, greyLight, greyLighter, white } from '../shared/base.hl'
  8. // the box model for every element: ::before and ::after have no form in the language, so the selector list stays quoted
  9. '*, *::before, *::after' { boxSizing = 'border-box' }
  10. html { colorScheme = 'light' }
  11. body {
  12. margin = '0'
  13. font = '16px/1.5 system-ui, sans-serif'
  14. color = black
  15. background = white
  16. }
  17. a {
  18. color = black
  19. textDecoration = 'underline'
  20. textUnderlineOffset = '.2em'
  21. hover { textDecorationThickness = '2px' }
  22. }
  23. h1 {
  24. margin = '0 0 1rem'
  25. fontSize = '1.3rem'
  26. lineHeight = '1.3'
  27. color = black
  28. }
  29. h2 {
  30. margin = '0'
  31. fontSize = '1.1rem'
  32. color = black
  33. }
  34. '.muted' { color = greyDark }
  35. button {
  36. font = 'inherit'
  37. fontWeight = '600'
  38. minHeight = '2.75rem'
  39. padding = '.4rem .9rem'
  40. color = white
  41. background = black
  42. border = '0'
  43. borderRadius = '.4rem'
  44. cursor = 'pointer'
  45. hover { background = greyDark }
  46. }
  47. 'button.quiet' {
  48. color = black
  49. background = greyLighter
  50. hover { background = greyLight }
  51. }
  52. applicationHeader {
  53. position = 'sticky'
  54. top = '0'
  55. zIndex = '5'
  56. display = 'flex'
  57. flexWrap = 'wrap'
  58. alignItems = 'baseline'
  59. gap = '.2rem 1rem'
  60. padding = '.3rem 1rem'
  61. color = white
  62. background = black
  63. '.brand' {
  64. display = 'inline-flex'
  65. alignItems = 'center'
  66. minHeight = '2.75rem'
  67. fontWeight = '800'
  68. fontSize = '1.15rem'
  69. color = white
  70. textDecoration = 'none'
  71. }
  72. // the tagline only where there is room: on a phone the header is the brand alone (44 px target, no second line)
  73. p {
  74. display = 'none'
  75. margin = '0'
  76. color = grey
  77. fontSize = '.9rem'
  78. @media {
  79. minWidth = '40rem'
  80. display = 'block'
  81. }
  82. }
  83. }
  84. // ---- offline (mission 046, components/main.hl): the note under the header, and the probe whose endless animation is
  85. // the shell's 1 s tick (it must be rendered for the animation to run — not display none — so: invisible)
  86. offlineNote {
  87. display = 'block'
  88. padding = '.5rem 1rem'
  89. color = black
  90. background = greyLight
  91. }
  92. netProbe {
  93. position = 'fixed'
  94. left = '0'
  95. top = '0'
  96. width = '1px'
  97. height = '1px'
  98. opacity = '0'
  99. pointerEvents = 'none'
  100. animation = 'components-net-tick 1s linear infinite'
  101. }
  102. '@keyframes components-net-tick' = {
  103. 'from' = { opacity = '0' }
  104. to = { opacity = '0' }
  105. }
  106. main {
  107. display = 'block'
  108. maxWidth = '40rem'
  109. margin = '0 auto'
  110. padding = '1rem'
  111. }
  112. // ---- the home ---------------------------------------------------------------------------------
  113. '#components' {
  114. display = 'grid'
  115. gap = '.5rem'
  116. margin = '0'
  117. padding = '0'
  118. listStyle = 'none'
  119. li {
  120. display = 'grid'
  121. gap = '.15rem'
  122. padding = '.7rem 1rem'
  123. background = greyLighter
  124. borderRadius = '.5rem'
  125. }
  126. p {
  127. margin = '0'
  128. color = greyDark
  129. }
  130. a {
  131. display = 'flex'
  132. alignItems = 'center'
  133. minHeight = '2.75rem'
  134. }
  135. }
  136. // the demo pages' Send row: air between the field and its button, whatever the page's paragraph margin
  137. '.demo-send' { margin = '1rem 0 0' }
  138. // "You are: alice bob nobody": a labelled group of buttons, the chosen one filled, the others quiet
  139. '.comments-who' {
  140. display = 'flex'
  141. flexWrap = 'wrap'
  142. alignItems = 'center'
  143. gap = '.5rem'
  144. }
  145. // ---- the Markdown editor demo ------------------------------------------------------------------
  146. mdEditorDemo {
  147. h2 {
  148. margin = '1rem 0 .3rem'
  149. fontSize = '1rem'
  150. }
  151. pre {
  152. margin = '0 0 1rem'
  153. whiteSpace = 'pre-wrap'
  154. overflowWrap = 'anywhere'
  155. }
  156. }
  157. // a child combinator: no form in the language
  158. 'md-editor-demo form > md-editor' { margin = '0 0 1rem' }
  159. // ---- the modal demo --------------------------------------------------------------------------------
  160. '.modal-openers' {
  161. display = 'flex'
  162. flexWrap = 'wrap'
  163. gap = '.5rem'
  164. }
  165. modalDemo {
  166. input {
  167. font = 'inherit'
  168. padding = '.35rem .6rem'
  169. color = black
  170. background = greyLighter
  171. border = '0'
  172. borderRadius = '.4rem'
  173. }
  174. }
  175. // ---- the pick-first demo (files upload in pick mode, ticket #18): a chat input — the field and Send in one row, Send 44 px high
  176. '#sent' {
  177. display = 'grid'
  178. gap = '.5rem'
  179. margin = '0 0 1rem'
  180. padding = '0'
  181. listStyle = 'none'
  182. li {
  183. padding = '.5rem .8rem'
  184. background = greyLighter
  185. borderRadius = '.5rem'
  186. }
  187. p {
  188. margin = '0'
  189. overflowWrap = 'anywhere'
  190. }
  191. '.sent-files' {
  192. fontSize = '.85rem'
  193. color = greyDark
  194. }
  195. }
  196. '#chat-form' {
  197. display = 'flex'
  198. gap = '.5rem'
  199. alignItems = 'flex-end'
  200. }
  201. '#chat-text' {
  202. flex = '1'
  203. minWidth = '0'
  204. minHeight = '2.75rem'
  205. font = 'inherit'
  206. padding = '.5rem .7rem'
  207. color = black
  208. background = greyLighter
  209. border = '0'
  210. borderRadius = '.4rem'
  211. resize = 'vertical'
  212. }
  213. '#chat-send' {
  214. minHeight = '2.75rem'
  215. minWidth = '2.75rem'
  216. }

Branches

Latest commits

  • a72b57cficons: nest Style rules in the language's formmre
  • 927616e2pagination: nest Style rules in the language's formmre
  • aab8ad29code-editor: nest Style rules in the language's formmre
  • ba30727afile-upload: nest Style rules in the language's formmre
  • 42fefa4emodal: nest Style rules in the language's formmre
  • 6fd953e3range-picker: nest Style rules in the language's formmre
  • f661951ddate-picker: nest Style rules in the language's formmre
  • 363577e6media-player: nest Style rules in the language's formmre
  • 0b3fd8c9comments: nest Style rules in the language's formmre
  • 67e043c8plugins/web/README.md from hybriel cb9e480dmre
  • 519b56e9styles.hl: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • 29f63d01md-editor: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • 869f49c7files-upload: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • f60dab20month-view: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • 5b3c349aRe-vendor to Hybriel set day35 (cb9e480d): plugins core and web sources, README vendoring notemre
  • 3449b117components: a startup error prints its message before exit 1 (hybriel#247)mre
  • 59704ce1Merge branch 'n5b-pipes'mre
  • 23b9164aMdEditor: a clipboard whose text is only the names or file:// paths of its files (a file manager copy) is about the files, as before; any other text wins (tickets#49); gate casesmre
  • b0f1ec28MdEditor: a clipboard with text always pastes the text, also when a picture is on it too (a spreadsheet or office app), files on or off; a picture alone still goes to the files; real Ctrl+V gate tests/md-paste-files.mjs (tickets#49)mre
  • ad4e929bMdEditor: pipe rows without a delimiter row are a table (first row = header, short rows padded, written back without an invented | --- | line) (notes#5)mre