Closed gabrielloeb closed 7 years ago
thanks for trying to improve the buggyfill!
in which situation would one add <style>
to <body>
instead of <head>
?
In my testing, if a <style>
tag containing viewport units occurs in the document <body>
, it is not overridden if the buggyfill <style id="patched-viewport">
tag is appended to <head>
. On the other hand it works as expected if moved to follow them in the document. The change would optionally handle viewport units in stylesheets written in the document <body>
where I think the current approach does not.
Admittedly if this case interested you, handling it could be further constrained than a querySelector accepting any string.
As there's no way (and reason?) to work with scopes, I don't think it makes sense to provide a selector here, as you'd either append to <head>
or <body>
. So I'd make that option a boolean (defaulting to false) called appendToBody
.
Thank you! I've merged your changes to master 19d6698. I've added a bit of CSS to <body>
to properly demo this in index.html
I don't know if this change might interest you, but it was one that I required for my purposes. Use case: override stylesheets in document body.