123
Views
2
Comments
Solved
Reactive application, change color of disabled button

Hello,

For my reactive application, I have a button that have a few variables that affect whether it is enabled or not. Currently, I am changing the color of the button based on the those few variables. Is it possible to simplify it and just change the color of the button based on whether it is enabled or not? Thank you!

2020-03-12 15-06-24
Steven Decock
Solution

Hi, 

If you inspect your disabled button in Chrome dev tools for example, you'll see that OutSystems styles disabled buttons using this css:

.btn[disabled] {
  background-color: var(--color-neutral-2);
  ... 
  color: var(--color-neutral-6); 
}

So, you could put that same CSS in your own theme, using your own colours.

Or add a class name to the CSS rule to only target buttons with, for example, the class 'mybutton' on it:

.btn.mybutton[disabled] {
  background-color: var(--color-neutral-2);
  ... 
  color: var(--color-neutral-6); 
}

UserImage.jpg
Low Nico

Hello,

Thank you, didnt know the trick with Chrome dev tools to see the properties of a button. Thank you for your help on this !

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