Join the Webstudio community

Updated 4 weeks ago

Determining the appropriate use of tokens when styling a button

when clearing styles on local token for a button it currently doesn't remove the background color and border. Does it make sense for me to create a reset token or simply create a dedicated token for the element I'm working on? I feel like I could possibly be creating more tokens and over complicating things and would be nice to know if there are any standards that I should be following when using tokens.
O
D
J
16 comments
you mean it doesn't remove your background color?
sorry let me redo that
when I clear styles I was thinking it woulds remove the default background color and border of the button element
same with the padding as well
so my thinking was I would just create a reset token that clears all the styles but that seems a bit silly.
I feel like I can go as crazy as I'd like with tokens and set myself up for failure where I over complicate the template / design with a shit load of unncessary tokens
is there a set standard that I should adhere when using tokens?
styles manager would definatly help
but no coders styles may be a burden as well, that's why I'm trying to keep everything in the box of the UI when working on these community shared templates.
Variables will help a bunch. Also the styles that are left over are browser defaults, webstudio isn't setting them. I know that can be annoying but when global tag styling comes out it should help reduce the annoyance.

As far as token strategy, currently my method is creating tokens for any styles that have a lot of input options like font sizes and colors. I personally think its a waste and bloats the UI to create tokens for more black and white styles like text alignment, display flex, etc.

Until either variables or dynamic components come out, tokens are a bit messy. For example if you create a Card you have to decide between hard coding all your styles to Card token or adding 5+ tokens to create a card an making sure you always add those 5 when adding a new card
Oh, you wanted to reset everything including browser defaults.

We want to enable this with tag styles where you can set the styles the way you want on the tag, so that it's globally availabe
Css does have one thing: reset: all

If we added this, all properties would reset with one click.
hey john, i appreciate your input in regards to the matter of tokens. I was going down that rabbit hole of treating the token as if they were utility classes and then I thought about how much of a pain in the ass it will be to keep track of the token names and on top of that it just seems a bit cumbersome and confusing if someone clones one of my community templates and it's loaded with a plethora of tokens.
yes! that's exactly what I'm looking for!
Add a reply
Sign up and join the conversation on Discord