Code Monkey home page Code Monkey logo

Comments (2)

c1rrus avatar c1rrus commented on May 12, 2024

Thank you for your suggestion. I think it definitely makes sense to reuse existing standards and conventions where possible and not reinvent the wheel. We do already draw some inspiration from CSS (e.g. the px and rem units for dimension tokens).

However, we also need to be mindful that:

  1. Design tokens are intended to be platform-agnostic. They may be translated into various programming lanugages (e.g. CSS, Android resource XML files, iOS Swift code, etc.) and also used in UI design tools (e.g. Figma, Sketch, etc.) and, potentially may be used in other contexts too (e.g. rendered as visual previous in a style guide). That doesn't mean we can't mimic CSS's syntax where is makes sense, but it might mean we restrict ourselves to a sub-set of what CSS can do because other tools/platforms lack equivalent features. Or, we at least need to specify what fallback behaviour should be in tools/platforms that don't support certain kinds of values.
  2. Unlike CSS, our format is JSON-based. Sometimes it therefore makes sense to use more JSON-like values than CSS ones. For example the cubic bézier example you cited. Fundamentally, it's a tuple with 4 numbers. In CSS that's expressed as a function cubic-bezier(...). If we were to use that directly in our spec, it would need to be something like a string value like this: "value": "cubic-bezier(...)". However, we've chosen to use a plain JSON array containing number values. That saves tools needing to parse the string to get those 4 numbers.
  3. We're currently aiming at a v1 spec, so we want to focus on the most commonly used things. Adding too much complexity now would delay completing that v1 and also risks adding things that hardly anyone uses. Our preference is to start small and then iterate in future spec versions based on how people end up using the spec. It's easy to add more ways of expressing values in future versions, but we can't change or remove existing ones without it being a breaking change.

Does that make sense?

from community-group.

c1rrus avatar c1rrus commented on May 12, 2024

The spec editors have reviewed this issue and, given that there's been no further comments, have decided to close this. We thank you for your suggestion, but will continue using our own value formats for the reasons I explained in the previous comment.

from community-group.

Related Issues (20)

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.