Question

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?

Was it helpful?

Solution

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 :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top