mirror of
https://github.com/atom/atom.git
synced 2026-02-07 05:05:02 -05:00
Replace requireStylesheet calls w/ @import directives in atom.less
This commit is contained in:
@@ -17,6 +17,7 @@ class Config
|
||||
themeDirPaths: [userThemesDirPath, bundledThemesDirPath, vendoredThemesDirPath]
|
||||
packageDirPaths: [userPackagesDirPath, vendoredPackagesDirPath, bundledPackagesDirPath]
|
||||
userPackagesDirPath: userPackagesDirPath
|
||||
lessSearchPaths: [fsUtils.join(resourcePath, 'static')]
|
||||
defaultSettings: null
|
||||
settings: null
|
||||
configFileHasErrors: null
|
||||
|
||||
@@ -25,12 +25,7 @@ window.setUpEnvironment = ->
|
||||
$(document).on 'keydown', keymap.handleKeyEvent
|
||||
keymap.bindDefaultKeys()
|
||||
|
||||
requireStylesheet 'reset'
|
||||
requireStylesheet 'atom'
|
||||
requireStylesheet 'overlay'
|
||||
requireStylesheet 'popover-list'
|
||||
requireStylesheet 'notification'
|
||||
requireStylesheet 'markdown'
|
||||
|
||||
if nativeStylesheetPath = fsUtils.resolveOnLoadPath(process.platform, ['css', 'less'])
|
||||
requireStylesheet(nativeStylesheetPath)
|
||||
@@ -142,7 +137,12 @@ window.requireStylesheet = (path) ->
|
||||
window.loadStylesheet = (path) ->
|
||||
content = fsUtils.read(path)
|
||||
if fsUtils.extension(path) == '.less'
|
||||
(new less.Parser({})).parse content, (e, tree) ->
|
||||
parser = new less.Parser
|
||||
syncImport: true
|
||||
paths: config.lessSearchPaths
|
||||
filename: path
|
||||
|
||||
parser.parse content, (e, tree) ->
|
||||
throw new Error(e.message, path, e.line) if e
|
||||
content = tree.toCSS()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user