3A minimalist layout language inspired by [elm-ui](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/) that compiles to static HTML.
5`@` means structure. Bare lines mean content. No CSS required.
14 @el [padding 20, background white, rounded 8, border 1 #e5e7eb, hover:border 1 $primary, transition all 0.15s ease]
18@column [max-width 800, center-x, padding 40, spacing 20]
19 @text [bold, size 32] Hello
22 Built with {@text [bold, color $primary] htmlang}.
24 @row [wrap, spacing 10]
26 Write layouts without CSS
28 Compiles to a single HTML file
31Compiles to a self-contained `.html` file with flexbox layout and generated CSS classes. No JavaScript, no external dependencies.
42htmlang page.hl # writes page.html
43htmlang --watch page.hl # recompile on change
48A VS Code extension with syntax highlighting and LSP integration is available in [`editors/vscode`](editors/vscode). The language server (`htmlang-lsp`) provides diagnostics, completions, and hover documentation.
55|--------------|------------------------------|
56| `@row` | Horizontal flex layout |
57| `@column` | Vertical flex layout |
58| `@el` | Generic container |
59| `@text` | Styled inline text |
60| `@paragraph` | Flowing text with inline elements |
63| `@raw` | Verbatim HTML escape hatch |
68@row [spacing 20] -- gap between children
69@row [gap-x 10, gap-y 20] -- separate horizontal/vertical gaps
70@el [padding 20] -- uniform padding (also padding-x, padding-y)
71@el [width fill] -- take remaining space (also width 200, width shrink)
72@el [center-x] -- center horizontally (also align-left, align-right)
73@el [overflow hidden] -- overflow behavior (hidden, scroll, auto)
79@el [background #3b82f6, color white, rounded 8, border 1 #e5e7eb]
80@text [bold, italic, underline, size 18, font Inter]
81@el [opacity 0.5, cursor pointer, transition all 0.15s ease]
82@el [shadow 0 2px 4px rgba(0,0,0,0.1)]
83@paragraph [text-align center, line-height 1.5]
89@el [position relative]
90 @el [position absolute, z-index 10]
96Prefix any style attribute with `hover:`, `active:`, or `focus:`:
99@el [background #3b82f6, hover:background #2563eb, active:background #1d4ed8]
102### Variables and defines
105@let primary #3b82f6 -- simple variable, used as $primary
106@define card [padding 20, rounded 8] -- attribute bundle, used as [$card]
113 @el [padding 12, background $primary, rounded 8]
114 @text [color white, bold] $label
115 @children -- slot for caller's children
117@button [label Click me]
123@include header.hl -- inline another .hl file
126### Multi-line attributes
128Attribute lists can span multiple lines:
135 shadow 0 2px 4px rgba(0,0,0,0.1)
143- `{@text [bold] inline}` elements in text
144- `@el [attrs] > @link url` single-child chaining
145- `[padding 20]` bare attributes as implicit `@el`
146- `@raw """..."""` for embedding arbitrary HTML/CSS/JS
150See [DESIGN.md](DESIGN.md) for the full language specification.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list