Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliasing objects at levels above value #205

Closed
chazzmoney opened this issue Nov 27, 2018 · 4 comments
Closed

Aliasing objects at levels above value #205

chazzmoney opened this issue Nov 27, 2018 · 4 comments
Labels
Core Architecture This is an issue related to the core architecture of Style Dictionary enhancement
Milestone

Comments

@chazzmoney
Copy link
Collaborator

What should happen if you try to reference a whole object that contains values?
What are the problems we are trying to solve with aliasing a whole object with values in it?

(#120, #198)

@chazzmoney chazzmoney added enhancement Core Architecture This is an issue related to the core architecture of Style Dictionary labels Nov 27, 2018
@chazzmoney
Copy link
Collaborator Author

I think that this could be useful for inheriting dictionaries or theming. @elliotdickison might have some thoughts?

@elliotdickison
Copy link

I usually do pretty granular references for theming (e.g. button-background-color-primary: theme-background-color-accent). I haven’t thought much about object level references for theming but it would be interesting to explore what that means.

Properties that I do often reference in bunches include things like border width/style/color or shadow spread/blur/offset/color. I have to admit though, since moving to js modules instead of json files I just require the properties that I need using node and merge them into new property objects with JavaScript.

@didoo
Copy link
Contributor

didoo commented Dec 8, 2018

Since I am the one that raised over and over this question, I want to make clear that my problem is not that I want/need this feature, it depends on real user-needs and up to now (I agree with @elliotdickison, the only case where I needed this was for a font declaration, so family, size, line-height, etc).

My main concern was that it was not clear in the documentation if this was possible, and in that case how to use it, and what to expect as a result. If there are no real/important use cases, I prefer to keep the overall complexity of Style Dictionary lower, and clearly state in the documentation that this is not allowed (so the only valid references would be to the "value"). My 2 cents.

@chazzmoney
Copy link
Collaborator Author

chazzmoney commented Aug 30, 2019

With the addition of #89, most use cases are likely covered by creating style dictionaries directly in javascript.

In the documentation on using alias/references in JSON property files, we do say this:

Note that this only applies to values; referencing a non-value property will cause unexpected results in your output.

Maybe we should be more clear?

In any case, we aren't considering adding this functionality at this time. If you stumble upon this issue and have a use case that requires it, please open a new issue that references this one and we can look at adding it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Architecture This is an issue related to the core architecture of Style Dictionary enhancement
Projects
None yet
Development

No branches or pull requests

3 participants