Elm does not appear to support HTML document's head node, <head>..</head>
.
The question is why not support the complete HTML document with suitable functions. It would seem such an inclusion would allow expedient use of external resources such as style sheets.
Apart from DOCTYPE
, HTML tags are uniformly, tagName attrList elmList
. Perhaps a set of appendAttr
and appendElm
functions could be concocted to allow flexibility for specifying a more comprehensive VirtualDom
.
Am I missing something?
By the time that your Elm code has loaded and starts running, the browser has already read in the <head>
of the HTML page that contains the Elm code, so it's too late to influence the contents of the <head>
.
Elm can be embedded into an element in the page, or run full-screen (which appears to add a child to the <body>
). Elm can only manipulate content within its container, not outside of it. In particular, all elements that Elm generates will be contained within the <body>
of the document, whereas <head>
is a sibling of <body>
.
It's possible to generate HTML elements with any name you like, using Html.node "elementName"
. So it's possible to create a <head>
element in Elm. However, a <head>
element created this way would end up inside <body>
, and I would expect browsers to ignore it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With