Join the Webstudio community

Updated last week

Problem witch switch from RADIX

Is it normal that when styling the RADIX "Switch" component, I don't see changes in the checked and unchecked states on the canvas? I can see the changes in the CSS preview, but they don't sync with the styles panel.
Attachment
switch.jpg
J
s
8 comments
@szymonszczechowicz, I can't replicate the issue. The colors change for me. I did notice that your state of the token is "checked", yet the switch state looks to be unchecked (default).
what am I missing?
I tested on both your token and the local token, they both adjust the color.
Unchecked also works for me. The issue is with the checked state. Can you review the changes in that mode?
Do you mean that you've tried changing the state and the switch doesn't actually change in the canvas (like this video)?

If you press the "play" button at the top right and toggle the switch, you can go back to the edit mode and change the color of the "checked" mode, and it will work.

I'm not sure if I understood your initial issue.
The issue is with styling. In the styles panel, I set the component state to "Checked," but the styles don't match what I see on the canvas. This affects things like color and the "translate" property. In the preview, everything looks correct. I tried to show this in the video. Sorry for not explaining the problem clearly.
Ah, I finally understand what you mean. I created a new switch with no styling. It seems like you're expecting the "checked token attribute" to toggle the "checked property." However, the Radix component doesn't work that way; you'd need to manually switch it from the play canvas. The @Webstudio Team might have some extra information; is it possible/advisable to bind the token state and property state?
Attachments
CleanShot_2024-12-30_at_14.16.102x.png
CleanShot_2024-12-30_at_14.15.562x.png
Add a reply
Sign up and join the conversation on Discord