How to alias in values from external files?
See original GitHub issueCurrently I have separated tokens into their respective package (typo, color, size etc), but how can i alias in size
into typo
? The generation of tokens happens in their respective packages.
like so, a spacing file at `packages/size:
{
"size": {
"spacing": {
"4": { "value": "0.25rem" }
}
}
}
That i want to be inherited into this file, at `packages/typography:
{
"size": {
"line-height": {
"4": { "value": "{tokens.size.spacing.4.value}" }
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
extern alias - C# Reference - Microsoft Learn
This creates the external aliases GridV1 and GridV2 . To use these aliases from within a program, reference them by using the extern...
Read more >ALIAS statement - IBM
The syntax of the ALIAS statement is: ALIAS { directoryname [( externalsymbol )]} {(SYMLINK, pathname )} {(SYMPATH, pathname )} [,...] ... Specifies an...
Read more >Create and remove aliases on Mac - Apple Support
Select the item, then choose File > Make Alias. You can create as many aliases for an item as you want, then drag...
Read more >Create Aliases to Rename Members in the View - Tableau Help
In the Data pane, right-click a dimension and select Aliases. · In the Edit Aliases dialog box, under Value (Alias), select a member...
Read more >External alias in XAML - Stack Overflow
I'm afraid the only way around this is to rip the contents of the .g.i.cs file and move it your .cs file, tweak...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are a few ways… For simplicity let’s focus on 2 packages, package A and package B. You want to reference a token from package A in package B.
.extend()
function on Style Dictionary is like creating a new instance of Style Dictionary with the configuration and tokens added into it (from source and include arrays). You can then export this object from one package (package A), import it in another package (package B) and add more tokens and configuration to it. You would need to filter out any tokens not from package A, which can be done with the newfilePath
attribute added in the upcoming version.include
array in the configuration, if you wanted to include tokens from another package. In package A you can generate a plain JSON file with the json format. Then in package B you can include that generated file. You will still need to filter out tokens when generating files in package B, but there is another token attribute,isSource
you can use.Hope this helps!
@chazzmoney yeah, sorry. haven’t tested the proposed solution yet, but will do. I had to manually insert values for the separate pacakges. Thank you 😃