forked from mystiq/hydrogen-web
Check if icon is in shared var
This commit is contained in:
parent
9a96112146
commit
2dd655cd9a
1 changed files with 3 additions and 2 deletions
|
@ -55,7 +55,8 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }) {
|
||||||
|
|
||||||
function populateMapWithIcons(map, cssFileLocation) {
|
function populateMapWithIcons(map, cssFileLocation) {
|
||||||
const location = cssFileLocation.match(/(.+)\/.+\.css/)?.[1];
|
const location = cssFileLocation.match(/(.+)\/.+\.css/)?.[1];
|
||||||
if (map.has(location)) {
|
const sharedObject = map.get(location);
|
||||||
|
if (sharedObject?.["icon"]) {
|
||||||
/**
|
/**
|
||||||
* This postcss plugin is going to run on all theme variants of a single theme.
|
* This postcss plugin is going to run on all theme variants of a single theme.
|
||||||
* But we only really need to populate the map once since theme variants only differ
|
* But we only really need to populate the map once since theme variants only differ
|
||||||
|
@ -63,7 +64,7 @@ function populateMapWithIcons(map, cssFileLocation) {
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
map.set(location, { "icon": Object.fromEntries(urlVariables) });
|
map.set(location, { ...sharedObject, "icon": Object.fromEntries(urlVariables) });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *
|
/* *
|
||||||
|
|
Loading…
Reference in a new issue