GithubHelp home page GithubHelp logo

Comments (4)

edwinmesmerise avatar edwinmesmerise commented on July 18, 2024

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.

lukasoppermann avatar lukasoppermann commented on July 18, 2024

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.

edwinbradford avatar edwinbradford commented on July 18, 2024

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.

lukasoppermann avatar lukasoppermann commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.