Join the Webstudio community

Updated 4 weeks ago

Allow the use of resources for token selection

Essentially.... just like the class attribute can grab its value from a resource origin, it would be cool that tokens could use it too.
O
T
12 comments
what's your use case?
1)
A product that in the backend has an array of shops where its found: The array is returned with name and slug of shop.
Right now using a collection it could use an element to display the logo by using the slug as a class name and that class name would contain the css for the ovewrall logo style and the background image of tat specific shop, while right now i could place the class name It would require creating the css for that class. A token would be able to handle the logos (especially if they are used somewhere else)
2) You have data rows, and maybe you have a status column, you want to display that status.
Right now that status can become a warning, danger, confirm class (like bootstrap classes) to format the row itself the way you need, importing something like bootstrap wpuld take care of this issue since it would handle the classes... but thats a lot of extra if maybe you ar ejust unsing that
I see, style variants probably will solve that in the future
if anything maybe a way to marry a class name to a token
there is a better thing that we plan adding
css conditionals
o god, that sounds awesome
@container style(--variant: true) {
token {
...
}
}
containers will be a layer above tokens
Add a reply
Sign up and join the conversation on Discord