5 ms·
So, does this mean the shadow DOM is a bad idea, in general, or is there something special about Atom that makes it a bad idea for Atom or maybe even text edito
by Someone 10y ago
So, does this mean the shadow DOM is a bad idea, in general, or is there something special about Atom that makes it a bad idea for Atom or maybe even text editors in general? If so, what's the criterion to use to decide whether one should use the shadow DOM?
- spankalee 10y agoSeems like the main concern was not being able to extract the editor component to use in other browsers. This could have been solved with the Shadow DOM polyfill, but it has a performance cost to it. Polymer's faster Shady DOM shim wasn't extracted into a standalone library until recently. The issues with themes and shared styles are largely solved by CSS Custom Variables, which inherit through shadow boundaries (much like /deep/), and Shadow DOM v1 (the new spec implemented by Safari and Chrome) which allows <link rel=stylesheet> tags inside shadow roots.
- bwat48 10y agoI don't think they're saying it's a bad idea in general, the issue here seems mostly related to the shadow dom making it difficult/complicated for people to theme atom/re-use components etc... I'm not a web developer but I'm sure there are valid use cases for it, as well as use cases such as this one where it's not ideal
- sametmax 10y agoWhich is strange given than shadow dom is supposed to make this easier.
- Zikes 10y agoIn general, the shadow DOM will have positive impacts on performance. Right now when you insert an element on a page it inherits all of the CSS of that page and must be evaluated accordingly, whereas a shadow DOM element can have a very small set of styles associated with it. These benefits won't be realized until the shadow DOM is fully implemented, however.