aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.babel.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-11-24 20:15:39 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-11-24 20:15:39 +0100
commit4ea044ae6b2e27e48d45bc3be1c366f4882bbda5 (patch)
treed19064b7370cb66ef66407de082bedad4c3128d4 /gulpfile.babel.js
parentdisable import/prefer-default-export (diff)
downloadferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.tar.gz
ferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.tar.zst
ferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.zip
feat(App): Lay groundwork for general themeing support
Diffstat (limited to 'gulpfile.babel.js')
-rw-r--r--gulpfile.babel.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index ad8adda2e..cea42d6c9 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -7,11 +7,20 @@ import { exec } from 'child_process';
7import dotenv from 'dotenv'; 7import dotenv from 'dotenv';
8import sassVariables from 'gulp-sass-variables'; 8import sassVariables from 'gulp-sass-variables';
9import { removeSync } from 'fs-extra'; 9import { removeSync } from 'fs-extra';
10import kebabCase from 'kebab-case';
11import hexRgb from 'hex-rgb';
10 12
11import config from './package.json'; 13import config from './package.json';
12 14
15import * as rawStyleConfig from './src/theme/default/legacy.js';
16
13dotenv.config(); 17dotenv.config();
14 18
19const styleConfig = Object.keys(rawStyleConfig).map((key) => {
20 const isHex = /^#[0-9A-F]{6}$/i.test(rawStyleConfig[key]);
21 return ({ [`$raw_${kebabCase(key)}`]: isHex ? hexRgb(rawStyleConfig[key], { format: 'array' }).splice(0, 3).join(',') : rawStyleConfig[key] });
22});
23
15const paths = { 24const paths = {
16 src: 'src', 25 src: 'src',
17 dest: 'build', 26 dest: 'build',
@@ -83,9 +92,9 @@ export function html() {
83 92
84export function styles() { 93export function styles() {
85 return gulp.src(paths.styles.src) 94 return gulp.src(paths.styles.src)
86 .pipe(sassVariables({ 95 .pipe(sassVariables(Object.assign({
87 $env: process.env.NODE_ENV === 'development' ? 'development' : 'production', 96 $env: process.env.NODE_ENV === 'development' ? 'development' : 'production',
88 })) 97 }, ...styleConfig)))
89 .pipe(sass({ 98 .pipe(sass({
90 includePaths: [ 99 includePaths: [
91 './node_modules', 100 './node_modules',