-
Notifications
You must be signed in to change notification settings - Fork 187
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
(Optionally) Use a singleton style tag to inject styles #6
Comments
Woah. Didn't know that 31 tag limit was a thing! We could probably make an option to append to an existing <style> tag instead of making a new one each time. |
Yeah, you can probably just create one with an id the first time and then |
Thanks for the bug report! Glad we got this now and not in production :) It sounds like webpack does many style tag insertions by default, but detects when its in <= IE9, and then switches automatically to appending to a single style tag. Shouldn't be too hard to implement. It would probably be good to land #1 too to help with this problem too. |
I looked into the perf implications of this, it looks like using more style tags is faster than appending to a style tag each time, but not appending to a style tag all the time is way better. I'm gonna look into this now. |
Oops, forgot to link to the jsperf: http://jsperf.com/append-to-style-vs-create-new-style |
IE9 will only use the first 31
<style>
tags (https://support.microsoft.com/en-us/kb/262161). Since AFAICT Aphrodite creates a<style>
tag for each class, it won't work on IE9 with a lot of components.I don't know what the perf implications of this are, but I know that webpack's style-loader (https://github.com/webpack/style-loader) has an option for whether to use a single style tag or to use multiple.
The text was updated successfully, but these errors were encountered: