andreincu / styler

Styler is a Figma plugin that provides a more efficient way to build and maintain design systems.
https://www.figma.com/community/plugin/820660579767995949/Styler
MIT License
58 stars 9 forks source link

Allow multiple text styles with same name #6

Open sverrehagen opened 3 years ago

sverrehagen commented 3 years ago

As the Figma style picker is clearly showing a preview of text styles (for instance, if the style is bold, regular or italic) it is sometimes very neat to just leave them all with the same name.

I'm guessing each style is identified by som unique ID under the hood, which is why Figma itself allows multiple text styles to have the same name. I would for instance like to have three styles called Body – one regular, one bold, and one italic.

It would be nice if this plugin could also allow that, rather than merging the styles and choosing one of them.

andreincu commented 3 years ago

Hey,

First, thanks for taking your time to write this! 😁

You're right about the part the Figma use an unique ID to identify the layers and the styles and link those together. But if the style is not attached to a layer, there is no way to identify it. (there is actually a more trickier one by properties and I'll look into that)

Still, the example you mentioned I don't think is doable in Figma, even natively. Looking forward to see an actual example of achieving this natively. 🙏

For this specific use case, I'm creating the following structure which works as expected using Styler since the names are different: Body / Regular Body / Bold Body / Italic

This will generate 3 styles, but will be inside a group called "Body" with 3 available styles.

Be caution, on empty spaces in the names! The plugin will see the following names as different:

sverrehagen commented 3 years ago

Hi again! It's definitely possible to do natively in Figma 👍

image