mirror of
https://github.com/atom/atom.git
synced 2026-02-06 12:44:59 -05:00
23 lines
706 B
CoffeeScript
23 lines
706 B
CoffeeScript
fs = require 'fs'
|
|
Theme = require 'theme'
|
|
|
|
module.exports =
|
|
class AtomTheme extends Theme
|
|
|
|
loadStylesheet: (stylesheetPath)->
|
|
@stylesheets[stylesheetPath] = window.loadStylesheet(stylesheetPath)
|
|
|
|
load: ->
|
|
if fs.extension(@path) in ['.css', '.less']
|
|
@loadStylesheet(@path)
|
|
else
|
|
metadataPath = fs.resolveExtension(fs.join(@path, 'package'), ['cson', 'json'])
|
|
if fs.isFile(metadataPath)
|
|
stylesheetNames = fs.readObject(metadataPath)?.stylesheets
|
|
if stylesheetNames
|
|
@loadStylesheet(fs.join(@path, name)) for name in stylesheetNames
|
|
else
|
|
@loadStylesheet(stylesheetPath) for stylesheetPath in fs.list(@path, ['.css', '.less'])
|
|
|
|
super
|