-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kangrui Ye <[email protected]>
- Loading branch information
1 parent
854a0f5
commit ba74dca
Showing
4 changed files
with
57 additions
and
3 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,46 @@ | ||
# Cloudflight Style Dictionary | ||
|
||
[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://opensource.org/licenses/Apache-2.0) | ||
![master](https://github.com/cloudflightio/cloudflight-style-dictionary-transformer/actions/workflows/build.yml/badge.svg?branch=master) | ||
[![@cloudflight/style-dictionary-transformer](https://img.shields.io/npm/v/@cloudflight/style-dictionary-transformer?label=@cloudflight/style-dictionary-transformer)](https://www.npmjs.com/package/@cloudflight/style-dictionary-transformer) | ||
|
||
Amazon style dictionary configured with Cloudflight best practices in mind. | ||
|
||
## Installation | ||
|
||
The following dependencies are required: | ||
|
||
``` | ||
"style-dictionary": "*" | ||
``` | ||
|
||
## Usage | ||
|
||
Create a javascript file with the following content: | ||
|
||
```javascript | ||
import { | ||
cloudflightPlatformConfigWith, | ||
registerItems, | ||
} from '@cloudflight/style-dictionary-transformer'; | ||
import StyleDictionary from 'style-dictionary'; | ||
|
||
registerItems(StyleDictionary); | ||
|
||
const StyleDictionaryExtended = StyleDictionary.extend({ | ||
source: ['assets/design-tokens/*.json'], | ||
platforms: { | ||
...cloudflightPlatformConfigWith({ | ||
styleDeclarationOutputDirectory: '<your-output-directory>', | ||
}), | ||
}, | ||
}); | ||
|
||
StyleDictionaryExtended.buildAllPlatforms(); | ||
``` | ||
|
||
Execute this script as part of your build. It will generate styles into you output directory for further use. | ||
|
||
## Contributing | ||
|
||
- [Contributing to the project](CONTRIBUTING.md) |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
:root { | ||
--color-my-super-fancy-red: hsl(0 100% 50%); | ||
--color-my-super-fancy-green: hsl(118 44% 33%); | ||
--color-my-super-fancy-red: #ff0000; | ||
--color-my-super-fancy-green: #327a30; | ||
} |