WIP Enable js defined theme to be used in SASS

This commit is contained in:
Dominik Prokop
2019-02-04 17:28:57 +01:00
parent 9e33f8b7c4
commit 7626ce9922
14 changed files with 506 additions and 123 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const getThemeVariable = require('./getThemeVariable');
module.exports = function(options) {
return {
@@ -23,7 +24,15 @@ module.exports = function(options) {
config: { path: __dirname + '/postcss.config.js' },
},
},
{ loader: 'sass-loader', options: { sourceMap: options.sourceMap } },
{
loader: 'sass-loader',
options: {
sourceMap: options.sourceMap,
functions: {
'getThemeVariable($themeVar, $themeName: dark)': getThemeVariable,
},
},
},
],
};
};