I believe this could work for this case, thank you @DavidD .
I was curious if there is a way to change object variables as well for other uses.
Has anyone come across a method to achieve this?
you would have to have one of the functions like .setValue() with the component.
Alternatively, if you want to use a JS query to trigger it, you could have a JS query trigger a temporary state and reference the temporary state within the style's background
would look something like:
Hi there! As alluded to in this thread, many properties in Retool, including the styles, are currently read only. You cannot set them to be equal to a new value using =.
The general solution to this limitation is to use temporary state, which can overwritten with .setValue()
For the component styles specifically, if you can handle it via a ternary instead of having to create a state variable, that may be preferred, as it saves you some steps. We'll submit a feature request internally to support programmatically setting component styles
@Tess , thank you for the response. I appreciate you submitting a feature request. I believe it is important to have these types of customizable features, a specially for users that come from typical programming backgrounds and don't have such limitations.