mirror of
https://github.com/atom/atom.git
synced 2026-02-04 11:45:16 -05:00
29 lines
679 B
JavaScript
29 lines
679 B
JavaScript
const fs = require('fs-plus')
|
|
const path = require('path')
|
|
const Watcher = require('./watcher')
|
|
|
|
module.exports =
|
|
class BaseThemeWatcher extends Watcher {
|
|
constructor () {
|
|
super()
|
|
this.stylesheetsPath = path.dirname(atom.themes.resolveStylesheet('../static/atom.less'))
|
|
this.watch()
|
|
}
|
|
|
|
watch () {
|
|
const filePaths = fs.readdirSync(this.stylesheetsPath).filter(filePath => path.extname(filePath).includes('less'))
|
|
|
|
for (const filePath of filePaths) {
|
|
this.watchFile(path.join(this.stylesheetsPath, filePath))
|
|
}
|
|
}
|
|
|
|
loadStylesheet () {
|
|
this.loadAllStylesheets()
|
|
}
|
|
|
|
loadAllStylesheets () {
|
|
atom.themes.reloadBaseStylesheets()
|
|
}
|
|
}
|