1
0
Commit Graph

15 Commits

Author SHA1 Message Date
Markus Wüstenberg
4248e85def Add "checked" bool attribute
Fixes #127.
2023-05-11 11:22:01 +02:00
Markus Wüstenberg
8e4b1319d1
Add Step attribute (#126)
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step

Fixes #120.
2023-01-17 12:05:47 +00:00
Markus Wüstenberg
e11dcad518
Add ColSpan and RowSpan attributes (#125) 2023-01-17 13:00:16 +01:00
Markus Wüstenberg
32ad318ce8
Add EncType html attribute (#109) 2022-09-29 10:46:36 +00:00
Markus Wüstenberg
4858e5d47d
Mark the assert test helpers as such (#90)
Using `t.Helper()`.

Also move the assert package to be internal.
2021-10-06 20:49:43 +02:00
Josep Jesus Bigorra Algaba
33524d6836
Add loading and srcset HTML attributes (#86)
Useful for `img` and `picture` elements.

Fixes #85.

Co-authored-by: Josep Jesus Bigorra Algaba <josep@prowarehouse.nl>
2021-09-07 12:09:57 +02:00
Markus Wüstenberg
ec86ca5c71
Add video element and related attributes (#84)
Adds the `video` element and `loop`, `muted`, `playsinline`, `poster` attributes.
2021-06-18 09:39:47 +02:00
Markus Wüstenberg
7c0f2e4cbb
Add LinkStylesheet and LinkPreload components (#79)
These are often used in the `<head>` part of the HTML.
2021-06-08 16:52:57 +02:00
Markus Wüstenberg
3b7dceab89
Streamline HTML element API (#66)
There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `<strong><em>…</em></strong>` or `<h1>Something <em>something</em> something</h1>`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content.

This also means that all elements now have the same API.
2021-05-05 09:03:16 +02:00
Markus Wüstenberg
c899a050c0
Return Node from all helpers instead of NodeFunc (#62)
This makes it clearer that the helpers return a `Node` of any kind, and that the type is not important.

This also streamlines the API, as attribute helpers already return just `Node`.
2021-01-07 10:20:03 +01:00
Markus Wüstenberg
d41c4e5a85
Add data- attribute helper (#61)
Fixes #49.
2020-12-22 11:46:49 +01:00
Markus Wüstenberg
6efec2175f
Add aria-* and role attributes (#59)
Fixes #50.
2020-12-22 11:07:33 +01:00
Markus Wüstenberg
febffb600d
Simplify available elements (#55)
`a`, `form`, `img`, `input`, `label`, `option`, `progress`, `select`, and `textarea` are now just regular elements (without helper parameters), because:
- Sometimes the use case doesn't fit (`a` as anchor without href, for example)
- There's no reason these are special among the others, so streamlining them makes sense

Also added new attributes `action`, `alt`, `for`, `method` that I had somehow missed.
2020-12-10 14:20:33 +01:00
Markus Wüstenberg
100ae9e830
Rename Document to Doctype (#54) 2020-12-10 13:13:10 +01:00
Markus Wüstenberg
a76262652b
Move elements and attributes into html package (#52)
This makes it easier to use dot-imports.

Also updated the readme and examples with new usage, and move the `Classes` helper into the `components` package.
2020-12-10 13:00:23 +01:00