question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Token collisions were found

See original GitHub issue
⚠️  ./temp/time.json
While building time.json, token collisions were found; output may be unexpected.
    Output name 0 was generated by:
        time.transition.0   0
        time.delay.0   0
        time.duration.0   0
    Output name 1 was generated by:
        time.transition.1   120ms
        time.delay.1   50ms
        time.duration.1   1000ms

There really are unwanted is there a way to remove them or just hide them from the console via the config?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
alecgeatchescommented, Aug 15, 2022

For anyone still having this issue, the nested property can be set to true on your formatter function to avoid nested collision false positives:

const { minifyDictionary } = StyleDictionary.formatHelpers;

const formatter = ( { dictionary } ) => {
    return JSON.stringify( minifyDictionary( dictionary.tokens ), null, 2 );
};

// Avoid nested collision warnings
formatter.nested = true;

styleDictionary.registerFormat( {
    name: 'custom/json/nested',
    formatter: formatter,
} );

Note this is the same way built-in formats like json/nested work:

https://github.com/amzn/style-dictionary/blob/28787befb1a2c7173c64a2a4bef5b029d0799cce/lib/common/formats.js#L1243-L1246

2reactions
The-Code-Monkeycommented, Jan 20, 2021

@chazzmoney we aren’t actually giving them the same name these values are used being generated for a theme object for our styled-components / styled-system ui library, and we wanted to be able to call them like color.primary.0 which all works fine the only issue we have is that it thinks that time.delay.0 is the same as time.transition.0 their values might be the same but the reason they are different keys is so that they are used in the correct CSS property, and also we might want to change transitions across the board but leave the delays as is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A test of token collisions / anybody know how to have two ...
I've noticed while generating images that have two main subjects there is a tendency to have both blended together, as the two different ......
Read more >
How to manage your Design Tokens with Style Dictionary
Recently I have come across a tool, called Style Dictionary, developed by Danny Banks at Amazon, that allows you to manage design tokens...
Read more >
Design Tokens and Cross Platform Coherence - Part 3
Any property value collisions (i.e. the same token defined in multiple places) are detected, warning when the value of an existing token is ......
Read more >
Peter on Twitter: "Railway tokens are a clever way to avoid ...
Railway tokens are a clever way to avoid collisions on single track sections. The driver is required to pick up a token, which...
Read more >
Token Ring - Wikipedia
Token Ring is a computer networking technology used to build local area networks. ... and eliminating the collisions of contention-based access methods.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found