@@ -4,6 +4,7 @@ import { RawVariableReferenceMap } from '@/types/RawVariableReferenceMap';
4
4
import { defaultTokenValueRetriever } from '../TokenValueRetriever' ;
5
5
import { TokenSetStatus } from '@/constants/TokenSetStatus' ;
6
6
import { getVariablesWithoutZombies } from '../getVariablesWithoutZombies' ;
7
+ import { normalizeVariableName } from '@/utils/normalizeVariableName' ;
7
8
8
9
export async function getThemeReferences ( prefixStylesWithThemeName ?: boolean ) {
9
10
defaultTokenValueRetriever . clearCache ( ) ;
@@ -53,7 +54,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
53
54
const localVariables = await getVariablesWithoutZombies ( ) ;
54
55
55
56
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
57
58
if ( ! figmaVariableReferences . has ( normalizedVariableName ) ) {
58
59
figmaVariableReferences . set ( normalizedVariableName , variable . key ) ;
59
60
}
@@ -67,7 +68,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
67
68
// We'll also add local styles to the references in case of where we work with local sets
68
69
localStyles . forEach ( ( style ) => {
69
70
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
71
72
figmaStyleReferences . set ( normalizedStyleName , style . id ) ;
72
73
}
73
74
} ) ;
0 commit comments