atom/atom — pull request #3830 by nathansobo (2014-10-14 19:39:30+00:00)
Title: Extract style manager from theme manager

This is a step toward updating the text editor to use the shadow DOM (#3677).

Previously our style sheets were managed globally, but with the introduction of the shadow DOM we now need to be able to load stylesheets into specific contexts and not others. The theme manager was previously mutating the DOM directly when stylesheets were applied, which clashed with our requirement of loading specific stylesheets in specific contexts. This PR now introduces a new custom element ``, which interacts with the style manager at `atom.styles` to render the stylesheets in our head.

The next step will introduce targeting stylesheets to specific contexts. When an `` element is appended to a shadow root, it will only add child style elements that are targeted for that shadow root. If stylesheets are targeted with a specific context, they won't be loaded in the document's head.

Currently, the new style manager only focuses on *applying* stylesheets. Loading is still handled in the theme manager. It should probably be moved so the theme manager only deals with themes, not stylesheet loading, and compilation.