Giter VIP home page Giter VIP logo

Comments (3)

dev-nicolaos avatar dev-nicolaos commented on May 31, 2024

What pain is having the top level collection groups present in the structure causing? If the idea is just allowing consumers to type one fewer word when referencing a token, I'm not sure that its worth implementing. Here is my reasoning:

  • I worry the increasing number of export options in this plugin could start to make maintenance and debugging tricky, and may not be worth implementing.
  • As you point out, this also has the capacity to cause errors or a loss of data if there's a collision. Those are both pretty bad user experiences the plugin would need to try and explain for users who flip on the option without understanding the potential consequences. Today that just isn't a problem.
  • Most people likely won't be this plugin's raw output directly anyway, and I believe tools like Cobalt and Style Dictionary that consume the output allow you to implement custom transformers where the same affect could be achieved.

from figma-plugin.

james-nash avatar james-nash commented on May 31, 2024

What pain is having the top level collection groups present in the structure causing?

Not a huge amount, to be honest. In my case I'm using Cobalt UI to generate CSS custom properties from the DTCG file that Tokens Brücke exports out of Figma. By default, those top-level groups get included in the names, so I get stuff like:

:root {
  --collectionName-groupName-nestedGroupName-varName: #123456;
}

However, when designers select color vars in Figma, the collection name is not shown. They just see something like: "groupName/nestedGroupName" followed by a list of variable names. E.g.:

image
(those variables are all in a collection called "Theme", but that's not visible in the variable picker - at least for colors. The collection names do seem to show up for other types)

In order to better align what our designers and devs see, we therefore want to strip off the collection name in the CSS, so that developers would get something like:

  --groupName-nestedGroupName-varName: #123456;
  
  /* e.g. */
  --color-background-brand-subtlest-default: #654321;

We've already configured Cobalt to do that (as you had suggested).

However, it just got me thinking it might be nice if it could all just work without needing to do that custom config. Hence the feature suggestion.

Happy for this to be closed though since it's quite niche and probably doesn't justify the effort needed to implement this.

from figma-plugin.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.