Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ This format is based on the current spec draft of the [Design Tokens W3C Communi
It is much simpler and makes it easier to define custom transformers for amazon style dictionary.

Every token follows this structure ([learn more](https://github.com/lukasoppermann/design-tokens/blob/main/types/standardToken.d.ts)):
```js
type StandardTokenInterface = {
name: string,
$description?: string,
$value: StandardTokenValueType | StandardCompositeTokenValueType,
$type: StandardTokenTypes,
$extensions?: StandardTokenExtensionsInterface
}
```

#### Standard deprecated (previous W3C draft)
The standard format has been updated. To make migration easier, the old version was moved into standard deprecated.
This version will be removed in the future, we highly encourage to update to the `standard` version.

The only difference between this and the updated standard version is that the property keys of `value`, `type`,`description` and `extension` haven beend prefixed with a `$` in the new version.

```js
type StandardTokenInterface = {
name: string,
Expand Down
27 changes: 27 additions & 0 deletions src/config/format.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export type formatKeysType = {
VALUE: '$value' | 'value',
Comment thread
lukasoppermann marked this conversation as resolved.
Outdated
DESCRIPTION: '$description' | 'description',
TYPE: '$type' | 'type',
EXTENSIONS: '$extensions' | 'extensions',
NAME: 'name'
}

export const formatKeys: {
standardDeprecated: formatKeysType,
standard: formatKeysType
} = {
standardDeprecated: {
VALUE: 'value',
DESCRIPTION: 'description',
TYPE: 'type',
EXTENSIONS: 'extensions',
NAME: 'name'
},
standard: {
VALUE: '$value',
DESCRIPTION: '$description',
TYPE: '$type',
EXTENSIONS: '$extensions',
NAME: 'name'
}
}
Loading