Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to customize stylesheet attachment. #84

Closed
wants to merge 2 commits into from
Closed

Adds option to customize stylesheet attachment. #84

wants to merge 2 commits into from

Conversation

gabrielloeb
Copy link
Contributor

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.

@rodneyrehm
Copy link
Owner

thanks for trying to improve the buggyfill!

in which situation would one add <style> to <body> instead of <head>?

@gabrielloeb
Copy link
Contributor Author

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.

@rodneyrehm
Copy link
Owner

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.

@rodneyrehm
Copy link
Owner

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

@rodneyrehm rodneyrehm closed this Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants