-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix CLI, update basic example, fix android templates DTCG (#1235)
- Loading branch information
1 parent
344cf66
commit c06661d
Showing
16 changed files
with
493 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'style-dictionary': minor | ||
--- | ||
|
||
Re-add and update example basic, fix copySync command in CLI, fix android templates to use $type for DTCG tokens. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Basic Style Dictionary | ||
|
||
This example code is bare-bones to show you what this framework can do. If you have the style-dictionary module installed globally, you can `cd` into this directory and run: | ||
|
||
```bash | ||
npx style-dictionary build | ||
``` | ||
|
||
Otherwise, install Style Dictionary locally for this project first, `cd` into this directory and run: | ||
|
||
```bash | ||
npm init -y && npm install style-dictionary | ||
``` | ||
|
||
and then run the above command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
{ | ||
"source": ["tokens/**/*.json"], | ||
"platforms": { | ||
"css": { | ||
"transformGroup": "css", | ||
"buildPath": "build/css/", | ||
"files": [ | ||
{ | ||
"destination": "_variables.css", | ||
"format": "css/variables" | ||
} | ||
] | ||
}, | ||
"android": { | ||
"transformGroup": "android", | ||
"buildPath": "build/android/", | ||
"files": [ | ||
{ | ||
"destination": "font_dimens.xml", | ||
"format": "android/fontDimens" | ||
}, | ||
{ | ||
"destination": "colors.xml", | ||
"format": "android/colors" | ||
} | ||
] | ||
}, | ||
"compose": { | ||
"transformGroup": "compose", | ||
"buildPath": "build/compose/", | ||
"files": [ | ||
{ | ||
"destination": "StyleDictionaryColor.kt", | ||
"format": "compose/object", | ||
"options": { | ||
"className": "StyleDictionaryColor", | ||
"packageName": "StyleDictionaryColor" | ||
}, | ||
"filter": { | ||
"$type": "color" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionarySize.kt", | ||
"format": "compose/object", | ||
"options": { | ||
"className": "StyleDictionarySize", | ||
"packageName": "StyleDictionarySize", | ||
"type": "float" | ||
}, | ||
"filter": { | ||
"$type": "dimension" | ||
} | ||
} | ||
] | ||
}, | ||
"ios": { | ||
"transformGroup": "ios", | ||
"buildPath": "build/ios/", | ||
"files": [ | ||
{ | ||
"destination": "StyleDictionaryColor.h", | ||
"format": "ios/colors.h", | ||
"options": { | ||
"className": "StyleDictionaryColor", | ||
"type": "StyleDictionaryColorName" | ||
}, | ||
"filter": { | ||
"$type": "color" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionaryColor.m", | ||
"format": "ios/colors.m", | ||
"options": { | ||
"className": "StyleDictionaryColor", | ||
"type": "StyleDictionaryColorName" | ||
}, | ||
"filter": { | ||
"$type": "color" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionarySize.h", | ||
"format": "ios/static.h", | ||
"options": { | ||
"className": "StyleDictionarySize", | ||
"type": "float" | ||
}, | ||
"filter": { | ||
"$type": "dimension" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionarySize.m", | ||
"format": "ios/static.m", | ||
"options": { | ||
"className": "StyleDictionarySize", | ||
"type": "float" | ||
}, | ||
"filter": { | ||
"$type": "dimension" | ||
} | ||
} | ||
] | ||
}, | ||
"ios-swift": { | ||
"transformGroup": "ios-swift", | ||
"buildPath": "build/ios-swift/", | ||
"files": [ | ||
{ | ||
"destination": "StyleDictionary+Class.swift", | ||
"format": "ios-swift/class.swift", | ||
"options": { | ||
"className": "StyleDictionaryClass" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionary+Enum.swift", | ||
"format": "ios-swift/enum.swift", | ||
"options": { | ||
"className": "StyleDictionaryEnum" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionary+Struct.swift", | ||
"format": "ios-swift/any.swift", | ||
"options": { | ||
"className": "StyleDictionaryStruct", | ||
"imports": "SwiftUI", | ||
"objectType": "struct", | ||
"accessControl": "internal" | ||
} | ||
} | ||
] | ||
}, | ||
"ios-swift-separate-enums": { | ||
"transformGroup": "ios-swift-separate", | ||
"buildPath": "build/ios-swift/", | ||
"files": [ | ||
{ | ||
"destination": "StyleDictionaryColor.swift", | ||
"format": "ios-swift/enum.swift", | ||
"options": { | ||
"className": "StyleDictionaryColor" | ||
}, | ||
"filter": { | ||
"$type": "color" | ||
} | ||
}, | ||
{ | ||
"destination": "StyleDictionarySize.swift", | ||
"format": "ios-swift/enum.swift", | ||
"options": { | ||
"className": "StyleDictionarySize" | ||
}, | ||
"filter": { | ||
"$type": "dimension" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"colors": { | ||
"$type": "color", | ||
"black": { | ||
"$value": "#000000" | ||
}, | ||
"white": { | ||
"$value": "#ffffff" | ||
}, | ||
"orange": { | ||
"100": { | ||
"$value": "#fffaf0" | ||
}, | ||
"200": { | ||
"$value": "#feebc8" | ||
}, | ||
"300": { | ||
"$value": "#fbd38d" | ||
}, | ||
"400": { | ||
"$value": "#f6ad55" | ||
}, | ||
"500": { | ||
"$value": "#ed8936" | ||
}, | ||
"600": { | ||
"$value": "#dd6b20" | ||
}, | ||
"700": { | ||
"$value": "#c05621" | ||
}, | ||
"800": { | ||
"$value": "#9c4221" | ||
}, | ||
"900": { | ||
"$value": "#7b341e" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"dimensions": { | ||
"$type": "dimension", | ||
"0": { | ||
"$value": "0px" | ||
}, | ||
"1": { | ||
"$value": "4px" | ||
}, | ||
"2": { | ||
"$value": "8px" | ||
}, | ||
"3": { | ||
"$value": "12px" | ||
}, | ||
"4": { | ||
"$value": "16px" | ||
}, | ||
"5": { | ||
"$value": "20px" | ||
}, | ||
"6": { | ||
"$value": "24px" | ||
}, | ||
"7": { | ||
"$value": "28px" | ||
}, | ||
"8": { | ||
"$value": "32px" | ||
}, | ||
"9": { | ||
"$value": "36px" | ||
}, | ||
"10": { | ||
"$value": "40px" | ||
}, | ||
"11": { | ||
"$value": "44px" | ||
}, | ||
"12": { | ||
"$value": "48px" | ||
}, | ||
"13": { | ||
"$value": "52px" | ||
}, | ||
"14": { | ||
"$value": "56px" | ||
}, | ||
"15": { | ||
"$value": "60px" | ||
}, | ||
"max": { | ||
"$value": "9999px" | ||
} | ||
} | ||
} |
Oops, something went wrong.