views:

26

answers:

1

Suppose I have a css style like this:

.foo a, .foo a:visited .foo a:hover {
   /* some styles here */
 }

.bar table tr td{
   /* other style here */
 }

How do I identify them them in CSS resource? Specifically, what style name should I refer to in my own CssResource interface?

+1  A: 

The question is why would you want to refer to them? :) The CssResource is just a convenient way of referring to style names that get obfuscated by the GWT compiler. So, you'd put String foo() and String bar() in it, so that you could add those styles to your Widgets in your Java code. Now, say, you put a table in your Widget that has the .bar style applied - the .bar table tr td gets automagically applied to every cell of that table (as per usual CSS rules), you don't need to add any other style names, etc. so there's no need to refer to that (.bar table tr td) style directly like it's needed for the .bar style alone.

Hope that made sense :)

Igor Klimer
That does. I actually figured it out myself shortly after I posted the question but thanks all the same. I do have another question though, that is how to represent dependent style names, things like .Xxx-enabled {} or .Xxx-disabled {}
EnToutCas
No problem :) About your second question: there's an another question about that on SO (http://stackoverflow.com/questions/2052994/how-to-declare-dependent-style-names-with-uibinder), but without a definite answer, maybe something new came up since then?
Igor Klimer