Comments (3)
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.
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.:
(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)
- Reference tokens auto-referencing themselves in the exported JSON HOT 4
- Drop shadow effects: how to support multiple shadows in one effect? HOT 8
- $meta is not valid DTCG HOT 6
- Use of plugin within different teams and projects HOT 1
- Toggle token extensions on/off
- Select collections to push / export
- Implement support for more text style properties? HOT 5
- Effects key label is uppercase HOT 2
- No value key in token schema HOT 11
- Alias resolution with Style Dictionary HOT 11
- Multi-tenant HOT 2
- Multiple collection and modes HOT 28
- Sorting variables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from figma-plugin.