ecklf / tailwindcss-figma-plugin

Figma Plugin for Tailwind CSS
https://www.figma.com/community/plugin/738806869514947558/Tailwind-CSS
MIT License
269 stars 16 forks source link

[Feature Request] Overwrite existing styles #80

Closed leinardi closed 4 years ago

leinardi commented 4 years ago

Hi, I just found this plugin while I was looking for an automated way to import color styles. The plugin allows already to import many colors in bulk but, if I'm not wrong, doesn't allow to upgrade the previously imported colors.

I'm currently building a themeable design system with many different themes and hundreds of color styles so it would be really great if there was a way to update an already existing color if, for example, the name matches.

leinardi commented 4 years ago

Perhaps something similar to what regulator is doing: https://github.com/kaleidocode-app/regulator/blob/master/src/code.ts

With this code the plugin is renaming the Color style so I assume it should also be possible to change the color value.

ecklf commented 4 years ago

The plugin allows already to import many colors in bulk but, if I'm not wrong, doesn't allow to upgrade the previously imported colors.

@leinardi yeah you are right. As you probably saw in the code the styles are getting assigned a unique id. Do you think overwriting should be the default behavior or should it be adjustable via checkbox?

leinardi commented 4 years ago

I think this feature should be optional (with a checkbox): I can't think of any use case where you need to actually have duplicate colors but, if there are currently users that actually need the plugin to behave like that, it won't be right to break it for them.

Regarding the logic for this change I would suggest something like this:

If you don't mind I'd like to add a couple of other feature request needed by the theamable DS I'm working on (I'll create a separate issue for them).

ecklf commented 4 years ago

Added in #87 @all-contributors please add @leinardi for ideas

allcontributors[bot] commented 4 years ago

@impulse

I've put up a pull request to add @leinardi! :tada:

leinardi commented 4 years ago

@impulse @KA95DEV thank you both! This will make my work so much easier!