How to pass input parameters to CSS style sheet?
Application Type
Reactive

Hi,

We are working on Reactive Web application. So I have a requirement where I have an input taken from user say, ColorName. I have to set the same color for some text/container within the same screen. Is there any way that i could implement this in Outsystems. Please do suggest some Solution or approach on how can i achieve this.?

Thank you.

Hello Manoj Kumar M,

I don't understand 100% your issue, but see this example that I have made to see if this is what I want:

https://personal-gxzlvs5j.outsystemscloud.com/InputParameterCSS/Screen1?_ts=637822627878385769

I add the OML that you can see what I have done.

Hope it helps,

Nuno R

InputParameterCSS.oml

Thanks @Nuno Ricardo Rodrigues ,This helped me a lot.

Hi Manoj,


In this example,We are using the use of javascript.



What I would do in particular. It would be to define my colors in the theme class. and from a variable assign to the element.


first I define my colors, second I add the variable to which I will manipulate and change color.



Select the element, I add expression editor

If you have a previous class you concatenated it.

Now only from an assign prodia change the name of the class of the element.


Assigning the color I want.



I hope it helps you, tell me.

Best Regards,

CP

Hello Manoj Kumar M,

The solution presented by Cristian Angel Puma Villalva, is also valid. There is always different ways to solve the same problem.

Best Regards,

Nuno R


Thanks Cristian Angel Puma Villalva ,for your inputs

Hello Manoj Kumar M,

I don't understand 100% your issue, but see this example that I have made to see if this is what I want:

https://personal-gxzlvs5j.outsystemscloud.com/InputParameterCSS/Screen1?_ts=637822627878385769

I add the OML that you can see what I have done.

Hope it helps,

Nuno R

InputParameterCSS.oml

Thanks @Nuno Ricardo Rodrigues ,This helped me a lot.

Hi Manoj,


In this example,We are using the use of javascript.



What I would do in particular. It would be to define my colors in the theme class. and from a variable assign to the element.


first I define my colors, second I add the variable to which I will manipulate and change color.



Select the element, I add expression editor

If you have a previous class you concatenated it.

Now only from an assign prodia change the name of the class of the element.


Assigning the color I want.



I hope it helps you, tell me.

Best Regards,

CP

Hello Manoj Kumar M,

The solution presented by Cristian Angel Puma Villalva, is also valid. There is always different ways to solve the same problem.

Best Regards,

Nuno R


Thanks Cristian Angel Puma Villalva ,for your inputs

mvp_badge
MVP

Using custom properties and JavaScript might be your best bet. See e.g. here.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.