Skip to content

Commit 3b90db4

Browse files
committed
use normalizedVariableName util in getThemeReferences
1 parent 0242969 commit 3b90db4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/tokens-studio-for-figma/src/plugin/asyncMessageHandlers/getThemeReferences.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { RawVariableReferenceMap } from '@/types/RawVariableReferenceMap';
44
import { defaultTokenValueRetriever } from '../TokenValueRetriever';
55
import { TokenSetStatus } from '@/constants/TokenSetStatus';
66
import { getVariablesWithoutZombies } from '../getVariablesWithoutZombies';
7+
import { normalizeVariableName } from '@/utils/normalizeVariableName';
78

89
export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
910
defaultTokenValueRetriever.clearCache();
@@ -53,7 +54,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
5354
const localVariables = await getVariablesWithoutZombies();
5455

5556
localVariables.forEach((variable) => {
56-
const normalizedVariableName = variable.name.split('/').join('.'); // adjusting variable name to match the token name
57+
const normalizedVariableName = normalizeVariableName(variable.name); // adjusting variable name to match the token name
5758
if (!figmaVariableReferences.has(normalizedVariableName)) {
5859
figmaVariableReferences.set(normalizedVariableName, variable.key);
5960
}
@@ -67,7 +68,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
6768
// We'll also add local styles to the references in case of where we work with local sets
6869
localStyles.forEach((style) => {
6970
if (!figmaStyleReferences.has(style.name)) {
70-
const normalizedStyleName = style.name.split('/').join('.'); // adjusting variable name to match the token name
71+
const normalizedStyleName = normalizeVariableName(style.name); // adjusting variable name to match the token name
7172
figmaStyleReferences.set(normalizedStyleName, style.id);
7273
}
7374
});

0 commit comments

Comments
 (0)