From 42caa043da28957358c575772a9a23a2fc002c4e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 4 Mar 2018 11:11:11 +0100 Subject: [PATCH] theme: fix some errors and add alt-button theme extension --- app/main/theme.js | 2 +- package.json | 1 - scripts/build-css.js | 3 +-- src/browser/scss/style.scss | 4 ++-- src/browser/scss/themes/alt-buttons.scss | 13 +++++++++++++ 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/browser/scss/themes/alt-buttons.scss diff --git a/app/main/theme.js b/app/main/theme.js index 33ce97e1..e38be87d 100644 --- a/app/main/theme.js +++ b/app/main/theme.js @@ -27,7 +27,7 @@ class Theme { } else if (!theme.includes('.css') && fs.existsSync(path.resolve(__dirname + '/../browser/themes/' + theme + '.css'))) { this.files.push(path.resolve(__dirname + '/../browser/themes/' + theme + '.css')) } else { - console.error('Theme error: "' + themes + '" not found.') + console.error('Theme error: "' + theme + '" not found.') } } diff --git a/package.json b/package.json index 11e39c6b..06e0e747 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "debarm": "electron-installer-debian --src dist/open-stage-control-linux-armv7l/ --arch armv7l --dest dist/open-stage-control-linux-armv7l/ --icon resources/images/logo.png", "watch-css": "nodemon --watch src/browser/scss -e scss -x \"npm run build-css && node scripts/reload-css.js\"", "watch-js": "nodemon --watch src/browser/js -e js -x \"npm run build-js\"", - "watch-themes": "nodemon --watch app/main/themes -e css -x \"node scripts/reload-css.js\"", "build-css": "node scripts/build-css.js", "build-js": "node scripts/build-js.js > app/browser/scripts.js", "deploy-docs": "cd resources && mkdocs gh-deploy --clean && rm -rf site", diff --git a/scripts/build-css.js b/scripts/build-css.js index 2ead54a2..69f1262c 100644 --- a/scripts/build-css.js +++ b/scripts/build-css.js @@ -18,10 +18,9 @@ fs.readdirSync(indir + '/themes/').forEach(file => { }) - var result = sass.renderSync({ file: indir + '/style.scss', outputStyle: 'compressed' }) -fs.writeFileSync(outdir + '/style.css', result.css) +fs.writeFileSync(outdir + '/styles.css', result.css) diff --git a/src/browser/scss/style.scss b/src/browser/scss/style.scss index 7371ff26..bb88d194 100644 --- a/src/browser/scss/style.scss +++ b/src/browser/scss/style.scss @@ -1,5 +1,3 @@ -@import 'themes/default'; - @import 'reset'; @import 'scrollbars'; @@ -557,3 +555,5 @@ body { } } } + +@import 'themes/default'; diff --git a/src/browser/scss/themes/alt-buttons.scss b/src/browser/scss/themes/alt-buttons.scss new file mode 100644 index 00000000..c0ac9325 --- /dev/null +++ b/src/browser/scss/themes/alt-buttons.scss @@ -0,0 +1,13 @@ +.widget.push-container.on, +.widget.modal-container.on, +.widget.toggle-container.on:not(.led) +{ + background : var(--color-custom); +} +.widget.push-container.on > .label, +.widget.modal-container.on > .label, +.widget.toggle-container.on:not(.led) > .label +{ + color: var(--color-bg); + font-weight: bolder; +}