Comments (4)
Correction, on re-reading that solution it appears to relate to a config of Tokens Studio, not Style Dictionary, although it may still explain the cause and how they solve it.
from design-token-transformer.
hey, sorry for the very late reply.
This issue is probably related to some transformers you use.
Style dictionary can not render objects, so they need to be transformed. You need to use the transformers from this repo or build your own, to combine the objects in a way to output a string or number.
For example to create a padding you could use this: https://github.com/lukasoppermann/design-token-transformer/blob/main/src/web/webPadding.js
module.exports = {
type: 'value',
matcher: function (token) {
return token.type === 'custom-spacing'
},
transformer: ({ value: { top, left, bottom, right } }) => {
if ([bottom, left, right].every(v => v === top)) {
return `${top}px`
}
return `${top}px ${right}px ${bottom}px ${left}px`
}
}
from design-token-transformer.
Thanks and the delay is no problem but have you misunderstood this issue? I haven't run the project or made any changes, those entries are in your project, it looks like something might be wrong, bear in mind I'm completely new to it so I may have misunderstood.
from design-token-transformer.
The problem is that the correct transformers are not loaded. It should be fixed now.
However this is a relatively old workflow. While it works well with the plugin, I would generally recommend to build your won transformations for the plugin based on style-dictionary-utils.
from design-token-transformer.
Related Issues (15)
- Need correction in documentation HOT 2
- missing android platform HOT 3
- Flutter support HOT 7
- Resolve References using Style Dictionary HOT 8
- Transform-tokens workflow always creates the file design-tokens-example.tokens.json HOT 2
- Question - How to produce fontFamilies? HOT 3
- npm run transform-tokens cant find "global" form figma plugin export HOT 1
- Unit transforms don't seem to apply HOT 1
- rgba values becomes #0000000 HOT 1
- 422 Error sending tokens to url HOT 3
- Unable to receive the commit message in GitHub's pull request. HOT 5
- Style Dictionary 4 HOT 1
- Some units are called "pixel" while others are called "pixels" HOT 3
- Support nested variable transformation ([object Object]) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from design-token-transformer.