-
-
Notifications
You must be signed in to change notification settings - Fork 15
Replace blob approach with style elements #324
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
Conversation
✅ Deploy Preview for anchor-position-wpt canceled.
|
✅ Deploy Preview for anchor-polyfill ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
@mirisuzanne I'm curious if you have thoughts on the best approach between this PR and #323. The problemWe currently replace Solution A(#323) Pros: Smaller change in behavior Solution B(#324, this one) Pros: no need to reparse, may prevent other bugs that have not yet been encountered Both seem to work, but are there other issues we should take into consideration, or any of these items that you see as particularly impactful? |
|
I don't have any particular input here, it seems like you're asking the right questions. |
jgerigmeyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
| const blob = new Blob([css], { type: 'text/css' }); | ||
| const url = URL.createObjectURL(blob); | ||
| const link = document.createElement('link'); | ||
| // Replace link elements with style elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a brief note (and/or link to the issue/pr) explaining why we're doing this.
|
@jamesnw Do we have an issue for tracking whether we want to follow |
|
Spotted that this was released in 0.6.0-alpha. Installed it on projectwallace.com and seems to be running fine with relative paths now. Thanks for the fix! |
|
@bartveneman Great -- thanks for testing it out and letting us know! We'll likely do a full release today or early next week. |
Description
An alternate approach to #323 that injects all styles into the head, even if they were originally links.
Forked from css-imports to verify the example works.
Style and Link elements support different atttributes, and we'll want to revisit #262 to make sure there aren't impacts there. I think the most important one is
media, which is supported.Related Issue(s)
#314 #274
Steps to test/reproduce
https://deploy-preview-324--anchor-polyfill.netlify.app/