mirror of
https://github.com/atom/atom.git
synced 2026-02-17 10:01:25 -05:00
Break out window.applyStylesheet from window.requireStylesheet
This will be useful in applying generated stylesheets associated with themes.
This commit is contained in:
@@ -53,9 +53,11 @@ windowAdditions =
|
||||
|
||||
requireStylesheet: (path) ->
|
||||
fullPath = require.resolve(path)
|
||||
content = fs.read(fullPath)
|
||||
return if $("head style[path='#{fullPath}']").length
|
||||
$('head').append "<style path='#{fullPath}'>#{content}</style>"
|
||||
window.applyStylesheet(fullPath, fs.read(fullPath))
|
||||
|
||||
applyStylesheet: (id, text) ->
|
||||
unless $("head style[id='#{id}']").length
|
||||
$('head').append "<style id='#{id}'>#{text}</style>"
|
||||
|
||||
requireExtension: (name) ->
|
||||
extensionPath = require.resolve name
|
||||
|
||||
Reference in New Issue
Block a user