Aliaksei
Aliaksei

Reputation: 1457

CssResource change style

I have interface such as

public interface PopupPanelWithConfirmStyle extends ClientBundle {

  public static final PopupPanelWithConfirmStyle I = GWT.create(PopupPanelWithConfirmStyle.class);

  @Source("PopupPanelWithConfirmStyle.css")
  public Style css();

  public interface Style extends CssResource {

  @ClassName("popupPanelWithConfirmStyle")
  String popupPanelWithConfirmStyle();

  @ClassName("confirmButton")
  String confirmButton();
 }

}

adn I have standart PushButton which have gwt-PushButton-up,.gwt-PushButton-up-hovering,.gwt-PushButton-up-disabled,.gwt-PushButton-down,.gwt-PushButton-down-hovering,.gwt-PushButton-down-disabled and others styles

So I set PushButton style - confirmButton and write own css

.popupPanelWithConfirmStyle {
background: none repeat scroll 0 0 white;
padding: 3px;
z-index: 100;
}

.confirmButton{
border-radius: 2px 2px 2px 2px;
margin: 0;
text-decoration: none;
padding: 3px 5px;
}

@external confirmButton-up, confirmButton-up-hovering, confirmButton-up-disabled, confirmButton-down, confirmButton-down-hovering, confirmButton-down-disabled 

.confirmButton-up {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #BBBBBB #BBBBBB #A0A0A0;
border-style: solid;
border-width: 1px;
cursor: pointer;
}

.confirmButton-up-hovering {
border: 1px solid #939393;
cursor: pointer;
}

.confirmButton-up-disabled {
border: 1px solid #BBBBBB;
cursor: default;
opacity: 0.5;
}

.confirmButton-down {
border: 1px inset #666666;
cursor: pointer;
outline: medium none;
padding: 4px 4px 2px 6px;
}

.confirmButton-down-hovering {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #333333 #939393 #939393;
border-right: 1px solid #939393;
border-style: solid;
border-width: 1px;
cursor: pointer;
}

.confirmButton-down-disabled {
border: 1px outset #CCCCCC;
cursor: default;
opacity: 0.5;
}

When a I run gwt - I see so -

div tabindex="0" class="GGUR4G1EN GGUR4G1EN-up" role="button" aria-pressed="false"

What should I do? that .confirmButton-up will be converted in GGUR4G1EN-up

Sorry for my English.

Upvotes: 1

Views: 584

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

This is not possible currently: http://code.google.com/p/google-web-toolkit/issues/detail?id=4746

If you want to take advantage of dependent style names, you have to disable obfuscation for your class name (e.g. using @external in the CSS, not only for the -up, -hover, etc. variants, but also the primary style name). That means however that you can have naming conflicts between CSS resources.

Upvotes: 1

Related Questions