Skip to content

Commit

Permalink
use normalizedVariableName util in getThemeReferences
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-gupta7 committed Feb 26, 2025
1 parent 0242969 commit 3b90db4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { RawVariableReferenceMap } from '@/types/RawVariableReferenceMap';
import { defaultTokenValueRetriever } from '../TokenValueRetriever';
import { TokenSetStatus } from '@/constants/TokenSetStatus';
import { getVariablesWithoutZombies } from '../getVariablesWithoutZombies';
import { normalizeVariableName } from '@/utils/normalizeVariableName';

export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
defaultTokenValueRetriever.clearCache();
Expand Down Expand Up @@ -53,7 +54,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
const localVariables = await getVariablesWithoutZombies();

localVariables.forEach((variable) => {
const normalizedVariableName = variable.name.split('/').join('.'); // adjusting variable name to match the token name
const normalizedVariableName = normalizeVariableName(variable.name); // adjusting variable name to match the token name
if (!figmaVariableReferences.has(normalizedVariableName)) {
figmaVariableReferences.set(normalizedVariableName, variable.key);
}
Expand All @@ -67,7 +68,7 @@ export async function getThemeReferences(prefixStylesWithThemeName?: boolean) {
// We'll also add local styles to the references in case of where we work with local sets
localStyles.forEach((style) => {
if (!figmaStyleReferences.has(style.name)) {
const normalizedStyleName = style.name.split('/').join('.'); // adjusting variable name to match the token name
const normalizedStyleName = normalizeVariableName(style.name); // adjusting variable name to match the token name
figmaStyleReferences.set(normalizedStyleName, style.id);
}
});
Expand Down

0 comments on commit 3b90db4

Please sign in to comment.