0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/plugin-src/translators/styles/translateStylePath.ts

17 lines
320 B
TypeScript
Raw Permalink Normal View History

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(' / ');
};