This repository has been archived by the owner on Jul 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 364
Slate CSSVar Loader
Chris Berthe edited this page May 3, 2018
·
1 revision
Finds CSS custom properties (variables) in your stylesheets and replaces them with their corresponding Liquid variable found in the provided cssVariablesPath
option.
npm install --save-dev @shopify/slate-cssvar-loader
module.exports = {
module: {
rules: [
{
test: /\.s[ac]ss$/,
use: [
{
loader: '@shopify/slate-cssvar-loader',
},
{loader: 'css-loader'},
{loader: 'sass-loader'},
]
}
]
}
}
The slate-cssvar-loader
can be configured via the theme's slate.config.js
file:
{
"cssVarLoaderEnable": true,
"cssVarLoaderLiquidPath": ["src/snippets/css-variables.liquid"]
}
-
cssVarLoaderEnable
: Enable/disable CSS Variable loader plugin -
cssVarLoaderLiquidPath
: An array of string paths to Liquid files that associate css variables to Liquid variables