forked from mystiq/hydrogen-web
Produce a mapping of aliases to resolved colors
This commit is contained in:
parent
a6b6fef6d2
commit
0b241db058
1 changed files with 7 additions and 2 deletions
|
@ -153,8 +153,13 @@ module.exports = (opts = {}) => {
|
||||||
if (opts.compiledVariables){
|
if (opts.compiledVariables){
|
||||||
populateMapWithDerivedVariables(opts.compiledVariables, cssFileLocation);
|
populateMapWithDerivedVariables(opts.compiledVariables, cssFileLocation);
|
||||||
}
|
}
|
||||||
// Publish both the base-variables and derived-variables to the other postcss-plugins
|
// Also produce a mapping from alias to completely resolved color
|
||||||
const combinedMap = new Map([...baseVariables, ...resolvedMap]);
|
const resolvedAliasMap = new Map();
|
||||||
|
aliasMap.forEach((value, key) => {
|
||||||
|
resolvedAliasMap.set(key, resolvedMap.get(value));
|
||||||
|
});
|
||||||
|
// Publish the base-variables, derived-variables and resolved aliases to the other postcss-plugins
|
||||||
|
const combinedMap = new Map([...baseVariables, ...resolvedMap, ...resolvedAliasMap]);
|
||||||
result.messages.push({
|
result.messages.push({
|
||||||
type: "resolved-variable-map",
|
type: "resolved-variable-map",
|
||||||
plugin: "postcss-compile-variables",
|
plugin: "postcss-compile-variables",
|
||||||
|
|
Loading…
Reference in a new issue