Files
atom/src/app/atom-theme.coffee
Corey Johnson & Nathan Sobo 478a376c97 Less files work in atom themes
2013-03-11 10:02:19 -07:00

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