@cloudflight/style-dictionary-transformer

0.5.1 • Public • Published

Cloudflight Style Dictionary

License master @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:

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({
            web: {
                declaration: {
                    outputDirectory: '<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

Package Sidebar

Install

npm i @cloudflight/style-dictionary-transformer

Weekly Downloads

0

Version

0.5.1

License

Apache-2.0

Unpacked Size

88.4 kB

Total Files

65

Last publish

Collaborators

  • cloudflight-admin
  • jenglisch