Setting background color for a widget


Dear Dojo 2+ users,

I’m looking for a way to manually set the background color for a Button widget. Using a static stylesheet is not an option.

The color is stored as RGB value in a database and might be different for all buttons on the same widget.



In the meantime, I found two solutions:

#1: put a div inside the button and use the “style” attribute, as my button requires multiple lines, put another div inside which contains the lines. This is required to handle vertical centering.
Drawback is, that on iOS, buttons have rounded corners, and only the div inside has the correct background color

#2: create a new button class duplicating all of the old button class, add a style attribute and use it. Duplication is something, I’d really like to avoid, but because of all methods being private, this is required.

None of the solutions make me happy.

Just another question: Is there anyone here trying to use Dojo2? Or am I completely alone in this world?..