|
1 | 1 | # Examples
|
2 | 2 |
|
3 |
| -To get you started, there are some example packages included that you can use. You can take a look at the code on Github or you |
4 |
| -can use the CLI included to generate a new package using these examples. Here is how you can do that: |
| 3 | +To get you started, there are some example packages included that you can use. You can [take a look at the code on Github](https://github.com/amzn/style-dictionary/tree/master/example/) or you can use the CLI included to generate a new package using some of these examples. Here is how you can do that: |
| 4 | + |
5 | 5 | ```bash
|
6 |
| -$ mkdir MyStyleD |
7 |
| -$ cd MyStyleD |
| 6 | +$ mkdir MyFolder |
| 7 | +$ cd MyFolder |
8 | 8 | $ style-dictionary init [example]
|
9 | 9 | ```
|
10 |
| -Where `[example]` is one of: `basic`, `complete`, `npm`, `s3` |
| 10 | + |
| 11 | +Where `[example]` is one of: `basic`, `complete`. |
11 | 12 |
|
12 | 13 | ## Basic
|
13 | 14 | [View on Github](https://github.com/amzn/style-dictionary/tree/master/example/basic)
|
14 | 15 |
|
15 |
| -This example code is bare-bones to show you what this framework can do. Use this if you want to play around with what the Style Dictionary |
16 |
| -can do. |
| 16 | +This example code is bare-bones to show you what this framework can do. Use this if you want to play around with what the Style Dictionary can do. |
17 | 17 |
|
18 | 18 |
|
19 | 19 | ## Complete
|
20 | 20 | [View on Github](https://github.com/amzn/style-dictionary/tree/master/example/complete)
|
21 | 21 |
|
22 |
| -This is a more complete package and should have everything you need to get started. This package can be consumed as a Cocoapod on iOS, |
23 |
| -as a node module for web, and as a local library for Android. |
| 22 | +This is a more complete package and should have everything you need to get started. This package can be consumed as a Cocoapod on iOS, as a node module for web, and as a local library for Android. |
24 | 23 |
|
25 |
| -## npm |
26 |
| -[View on Github](https://github.com/amzn/style-dictionary/tree/master/example/npm) |
| 24 | +## Advanced |
| 25 | +[View the folder](https://github.com/amzn/style-dictionary/tree/master/example/advanced) |
27 | 26 |
|
28 |
| -This example shows how to set up a style dictionary as an npm module, either to publish to a local npm service or to publish externally. |
| 27 | +If you want to look at more advanced examples of possible applications and customisations of Style Dictionary, the `examples/advanced` folder on GitHub contains these extra folders: |
29 | 28 |
|
30 |
| -When you publish this npm module, the prepublish hook will run, calling the style dictionary build system to create the necessary files. You can also just run `npm run build` to generate the files to see what it is creating. |
| 29 | +* [**assets-base64-embed**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/assets-base64-embed) shows how it's possible to embed and distribute assets – like images, icons and fonts – directly as design tokens. |
| 30 | +* [**auto-rebuild-watcher**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/auto-rebuild-watcher) shows how to setup a "watcher" that auto-rebuilds the tokens every time there is a change in the properties. |
| 31 | +* [**custom-templates**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/custom-templates/custom-templates) shows how to use "custom" templates to generate design tokens files with custom formats, useful when you need to distribute your design tokens and integrate them with custom pipelines or scripts. |
| 32 | +* [**custom-transforms**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/custom-templates/custom-transforms) shows how to use custom tranforms (and transformGroups) to apply custom "tranformations" to the properties when converted to design tokens. |
| 33 | +* [**multi-brand-multi-platform**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/multi-brand-multi-platform) shows how to set up Style Dictionary to support a multi-brand (for brand theming) and multi-platform (web, iOS, Android) solution, with property values depending on brand and plaforms. |
| 34 | +* [**npm-module**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/npm-module) shows how to set up a style dictionary as an npm module, either to publish to a local npm service or to publish externally. |
| 35 | +* [**s3**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/s3) shows how to set up a style dictionary to build files for different platforms (web, iOS, Android) and upload those build artifacts, together with a group of assets, to an S3 bucket. |
| 36 | +* [**referencing_aliasing**](https://github.com/amzn/style-dictionary/tree/master/example/advanced/referencing_aliasing) shows how to use referencing (or "aliasing") to reference a value -or an attribute– of a property and assign it to the value –or attribute– of another property. |
31 | 37 |
|
32 |
| -## s3 |
33 |
| -[View on Github](https://github.com/amzn/style-dictionary/tree/master/example/s3) |
34 | 38 |
|
35 |
| -One way to use the style dictionary framework is to build files for each platform and upload those build artifacts to an s3 bucket. The platforms can pull these files down during their build process. |
| 39 | +--- |
36 | 40 |
|
37 |
| ----- |
| 41 | +#### Do you think an example is missing?<br/>Do you want to see another example added to the project?<br/>Do you have a working example that we can add to the list? |
38 | 42 |
|
39 |
| -> More coming soon... |
| 43 | +Fantastic! Let us know by [filing an issue](https://github.com/amzn/style-dictionary/issues) or sending us an email: style-dictionary@amazon.com. |
0 commit comments