Simple example. I have 2 styles declared in UiBinder:
<ui:style>
.success {
font-size: 13px;
margin: 15px;
font-weight: bold;
display: inline;
padding: 3px 7px;
background: #FFF1A8;
}
.error {
font-size: 13px;
margin: 15px;
font-weight: bold;
display: inline;
padding: 3px 7px;
background: #990000;
color: #fff;
}
</ui:style>
I also have a label that one of them is applied too.
<g:Label ui:field="statusLabel" styleName='{style.success}' />
Within UiBinder, is there a way that I would be able to go about programatically switching the style to the error style? It's nice being able to organize my CSS right there in the widget, and I haven't found another good way of organizing it.
If what I'm asking isn't possible, how should I be organizing my CSS in gwt, so that I don't end up with a giant pool of styles, and is also easy, and usable? I imagine there is a smart way to use a ClientBundle for this, but I haven't figured it out. I also think it'd be more convenient to be able to do the above mentioned way by just keeping everything in UiBinder without messing with another file. Either way, please help me before this gets out of hand!