mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Hack: Add editor stylesheets to atom-text-editor shadow root
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user