How to change input widget style?

0
Is it worth to change input border color (when enter event) or just start a widget from scratch ?
asked
2 answers
1

Hi Zunino,

 

if you want to change the style depending on the input, dynamic classes are the way to go, as Martijn suggested. If you want to change the style depending on the length of the input, you could define a dynamic class like this:

 

image.png

 

If you add the following styles to your App/Styling/web/main.scss, you will see the result:

 

image.png

 

- the ":focus" pseudo class corresponds to your initial request to change the style when the text box is entered

- the ".red-border" and ".green-border" define how the widget should look depending on the active dynamic class

-the ".mx-textbox" class designates a text input field from the Mendix toolbox. 

 

In the long run, you would put your custom styles in different files of course, but that is besides the point.

 

 

answered
1

Hi Zunino,

 

You can just create your own class and add it to the Appearance tab of the input widget to override the Mendix styling. There is no need to start a widget from scratch.

 

Hope this helps!

answered