You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently cannot insert styles to document.adoptedStyleSheets, because for backwards compatibility we need to continue appending global stylesheets as <style>s to the document.head.
However, there is some data showing that document.adoptedStyleSheets is a performance win (#2683#2460), and it's cleaner in our code to just use one system both at the global level and at the local (shadow root) level, so it would be beneficial to use document.adoptedStyleSheets.
The text was updated successfully, but these errors were encountered:
nolanlawson
changed the title
Insert global styles in document.adoptedStyleSheets
Insert global stylesheets into document.adoptedStyleSheets
Jul 6, 2022
Well #2923 actually showed there's a slight perf improvement for using <style>s in Chrome anyway, so this may need to be re-evaluated in the future. It makes no sense to me that the ceremony of creating a DOM node just to add a style actually improves perf relative to constructable stylesheets, but maybe Chrome has optimized one case more than the other.
We currently cannot insert styles to
document.adoptedStyleSheets
, because for backwards compatibility we need to continue appending global stylesheets as<style>
s to thedocument.head
.However, there is some data showing that
document.adoptedStyleSheets
is a performance win (#2683 #2460), and it's cleaner in our code to just use one system both at the global level and at the local (shadow root) level, so it would be beneficial to usedocument.adoptedStyleSheets
.The text was updated successfully, but these errors were encountered: