Theo is a design tokens formatter and transformer library maintained by Salesforce UX. The latest stable version is 8.1.5, released on npm under an Apache-2.0 license. It provides a declarative way to convert design tokens defined in YAML/JSON into platform-specific formats such as SCSS, CSS custom properties, JavaScript, Swift, Android XML, etc. Key differentiators: supports custom transforms and formats, works with a variety of token file formats, and has a plugin system for additional build tool integrations (gulp). Note that starting from v6, the gulp plugin is distributed separately as gulp-theo.
npm install theoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to convert a YAML design token string to SCSS using Theo's convert method with web transform and scss format.
npm install gulp-theo --save-dev and update your gulpfile to require 'gulp-theo' instead of accessing theo.gulp.
Use yaml.parse() on JSON content if you want to pass JSON data directly; otherwise, ensure your input file is valid YAML.
Call theo.registerTransform or theo.registerValueTransform before any convert calls.
Ensure your tokens object has a top-level 'props' key: { props: { token_name: { value: '...', type: '...' } } }.Use one of the built-in transform types or register a custom one with theo.registerTransform() before calling convert.
Use a valid format type name or register a custom format with theo.registerFormat() before calling convert.
No dependency data recorded yet.