For all the fields, be it input. dropdown, text area, so on and so forth, when the enabled is set to "False" it greys out the entire box, disable edits make by user. However, the front color seems to be lighter and making it harder to read, is there a way to override and change all disabled field font to black?
P.S: Tried to use the style: color: black;
it works but, doesn't seem to be an efficient way of doing if I need to do all the input fields one by one.
Hi Chin,
You can use the following CSS in your stylesheet:
/********** This CSS for disabled input and text areas ********/
.form-control[data-input]:disabled,
.form-control[data-textarea]:disabled {
color: black;
}
/********** This CSS for all form controls (inputs, textareas, etc.) ********/
.form-control { color : black !important;}You can choose any of the above options depending on your specific requirement. The first one targets only disabled fields with specific attributes, while the second one applies to all form controls.
Hi Faais, Great work! But do you have the one for dropdown widget? I tried but did not work with,
.dropdown-display [disabled] {
or
.dropdown-disabled { color: black;}
Alright, for that, you can write the following CSS. It will work! div.dropdown-display.dropdown-disabled, div.dropdown-display[disabled], select.dropdown-display.dropdown-disabled, select.dropdown-display[disabled] { color:black;}
Thanks @Faais ! Greatly Appreciated!
in the philosophy of "Teach him how to fish" : finding out yourself is not difficult, you just need to know where to look :
All the above is enough to find what selector you would have to use in your CSS, but if you are up to it, here's a little extra treat.
When in doubt, you don't have to go back to Service Studio, edit CSS, publish and refresh the screen to find out if you have choosen the right selector, you can edit right there in the styles tab to test it. You can add the intended CSS as part of an extra temporary inspector stylesheet.
Bear in mind this is not exactly the same as adding the CSS somewhere in your project, because in your OutSystems application, there is an order of stylesheet loading you have to know about. But for overruling OutSystems UI selectors, doing it in your module or theme will be fine.
Dorine
Hi @Dorine Boudry , I tried the inspect element before and was unable to achieve the results I want as I only stopped at the first stage as shown in your reference,
.
Missed out on this part. Thanks for highlighting and enlightening me with your approach. Greatly Appreciated!
We use this CSS to style disabled inputs.
.form-control[data-input][disabled], .form-control[data-textarea][disabled] {
border-radius: var(--border-radius-s);
border: 1.5px solid var(--color-neutral-2);
background: var(--color-neutral-2);
color: var(--color-neutral-7);
If you're not familiar with CSS in OutSystems, you can follow this course.
https://learn.outsystems.com/training/journeys/css-590