3

styledictionary/4/instantiating-style-dictionary

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

What Changed

This codemod updates Style Dictionary to be a class in version 4, rather than a regular JS object. This allows for instance creation using the new class instantiator keyword. Due to ES Modules' asynchronous nature, you must await initialization before accessing properties like tokens on the instance. The .extend() method remains available for creating instances based on another instance.

Before

jsx

After

jsx

Ready to contribute?

Build your own codemod and share it with the community.