GithubHelp home page GithubHelp logo

Comments (3)

softmarshmallow avatar softmarshmallow commented on June 6, 2024

This is a very important subject, and we have a flags feature to contribute on it (still in preview stage).

Please take a look and share your thoughts!

p.s. your w3c link seems dead (404)

from assistant.

LilithWittmann avatar LilithWittmann commented on June 6, 2024

Oh wow, thank you, for your quick reply! Sorry, I fixed the w3c link.

Yes, I played a bit with the concept of the flag and I think it is really great for annotating something semantically e.g. as a button. But I don't see how this could be still user-friendly when you build e.g. a button with 5 different states (normal, hover, pressed, focus, disabled) and multiple attributes changes in each state (e.g. color, border, shadow).

So I thought it could be cool if you would have a w3c design token definition for each element that looks something like this:

{
   "button":{
      "variants":{
         "base":{
            "default":{
               "bg":{
                  "$value":"{colors.primary.20}"
               }
            },
            "hover":{
               "bg":{
                  "$value":"{colors.primary.80}"
               }
            }
         }
      }
   }
}

So you would have a nested structure of type -> variants -> state. This token structure could be managed with tools like Figma Tokens and then automatically applied to the generated code.

from assistant.

softmarshmallow avatar softmarshmallow commented on June 6, 2024

That is great. Infact it was something I was looking for.
Theres a lot on my table right now, I'll get on to this tomorrow and share my thoughts in details.

from assistant.

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.