Hack: Add editor stylesheets to atom-text-editor shadow root

This commit is contained in:
Nathan Sobo
2014-10-10 14:38:13 -07:00
parent 22212be90d
commit 963c92eb4e
2 changed files with 8 additions and 1 deletions

View File

@@ -25,6 +25,13 @@ class TextEditorElement extends HTMLElement
@classList.add('editor')
@setAttribute('tabindex', -1)
@shadowRoot = @createShadowRoot()
for styleElement in document.querySelectorAll('head style.syntax-theme')
@shadowRoot.appendChild(styleElement.cloneNode(true))
atom.themes.onDidAddStylesheet (sheet) =>
@shadowRoot.appendChild(sheet.ownerNode.cloneNode(true))
@root = document.createElement('div')
@root.classList.add('editor', 'editor-colors')
@shadowRoot.appendChild(@root)

View File

@@ -5,7 +5,7 @@ module.exports =
class ThemePackage extends Package
getType: -> 'theme'
getStylesheetType: -> 'theme'
getStylesheetType: -> "#{@metadata.theme}-theme"
enable: ->
atom.config.unshiftAtKeyPath('core.themes', @name)