html-creator
html-creator copied to clipboard
Feature: shortcuts for Tags
it takes too much time to write elements. there should be some shortcuts like this:
Tags.Meta({ charset: 'UTF-8' })
Tags.Head()
Tags.Title()
if the type not exist on the Tags, it should not be rendered.
Hi,
I appreciate the idea.
The issue is that you would lose the type safety of html elements if we were to move from the typescript interface HTMLElement to adding one method for each element tag. Moreover it would be necessary to create and sync each of the ~130 html tags with the methods.
Also, the time it takes to type Tags.Head() compared to addElement({ type: "head" }) is miniscule :)