Thursday, April 26, 2012

UIBinder: Overriding obfuscated CSS styleNames

Hello!

I've got a couple of uibinder-built widgets that use inline css. The
first is a custom toggle button that looks something like this:

class ToggleButton {
interface Style extends CssResource
{
public String down();
}

@UiField
Style style;

@UiField
ButtonElement buttonElt;
...

public void setDown(boolean down)
{
if (down)
addStyleName(style.down());
else
removeStyleName(style.down());
}
}

This class works great. However, trouble arises when i wish to use it
from within another uibound widget and override the down style. So far
i have this in my ui xml:

<ui:style>
.button {
background: #fff;
}

.button .down {
background: #fff;
}
</ui:style>

<g:HTMLPanel>
...
<e:CustomPushButton addStyleName="{style.button}">My White
Button</e:CustomPushButton>
</g:HTMLPanel>


Is it possible to override the .down secondary style?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment