mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Apply syntax theme stylesheets in text editor shadow DOM via atom.styles
This commit is contained in:
@@ -176,9 +176,10 @@ class Package
|
||||
activateStylesheets: ->
|
||||
return if @stylesheetsActivated
|
||||
|
||||
context = 'atom-text-editor' if @metadata.theme is 'syntax'
|
||||
group = @getStylesheetType()
|
||||
for [sourcePath, source] in @stylesheets
|
||||
@stylesheetDisposables.add(atom.styles.addStyleSheet(source, {sourcePath, sourcePath}))
|
||||
@stylesheetDisposables.add(atom.styles.addStyleSheet(source, {sourcePath, sourcePath, context}))
|
||||
@stylesheetsActivated = true
|
||||
|
||||
activateResources: ->
|
||||
|
||||
@@ -30,12 +30,6 @@ class TextEditorElement extends HTMLElement
|
||||
stylesElement.setAttribute('context', 'atom-text-editor')
|
||||
@shadowRoot.appendChild(stylesElement)
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user