0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00
penpot-exporter-figma-plugin/plugin-src/translators/styles/translateStylePath.ts
Jordi Sala Morales 53672d8b43
Fix style paths (#194)
* Fix style path

* add changelog
2024-06-28 08:32:56 +02:00

16 lines
320 B
TypeScript

export const translateStylePath = (figmaStyle: BaseStyleMixin) => {
const path = [];
if (figmaStyle.remote) {
path.push('Remote');
}
if (figmaStyle.name.includes('/')) {
const pathParts = figmaStyle.name.split('/');
pathParts.pop();
path.push(...pathParts);
}
return path.join(' / ');
};