Solving Problems with JavaScript: Variable Code Syntax | Figma

Publicado el: 06 febrero 2025
en el canal de: Figma
14,229
563

Running plugin API code in the JavaScript console is the best Figma feature you've never used. Here's the code:

const [collection] = await figma.variables.getLocalVariableCollectionsAsync();
collection.variableIds.forEach(async function arrow(id) {
const variable = await figma.variables.getVariableByIdAsync(id);
variable.setVariableCodeSyntax(
"WEB",
`var(--color-${variable.name.replace(/\//g, "-").toLowerCase()})`
)
})
____________________________________________________

Find us on ⬇️
X (formerly Twitter): https://x.com/figma
Instagram:   / figma  
LinkedIn:   / figma  
TikTok:   / figma  
Figma forum: https://forum.figma.com/


En esta página del sitio puede ver el video en línea Solving Problems with JavaScript: Variable Code Syntax | Figma de Duración hora minuto segunda en buena calidad , que subió el usuario Figma 06 febrero 2025, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 14,229 veces y le gustó 563 a los espectadores. Disfruta viendo!