On Apr 27, 6:15 pm, Thomas Broyer <[email protected]> wrote:

Thanks for the reply.

> > It does not mean that one could refer to a CssResource *outside* of
> > the <ui:style> scope though -- correct?
>
> No. The class name you use in your stylesheet won't be changed, so it
> will apply to the whole document (because "scoped stylesheets" do not
> exist); that's why the documentation talks about "legacy CSS".

Its starting to become clearer to me what's going on.
[I'm still catching up]

> I think browsers wouldn't choke on @external, but other CssResource
> features (@sprite, @def, @if, etc.) obviously won't work outside of
> CssResource, i.e. in ".html resources".

Well -- the @external and other CssResource features won't ever make
it to anywhere past the source code, right?  They all get compiled by
the GWT compiler into some amalgam of Java/CSS that should be
compatible with any standards-compliant rendering device, no?

> Why not just use the class names instead of trying to make it fit into
> a CssResource? (<g:MyWidget addStyleNames="my-MyWidget" />)

Where are you suggesting the definition for my-MyWidget live?

Also, the syntax won't guarantee that there aren't any typos or that
the style has been defined.  Whereas this alternate syntax provides
that:

> <g:MyWidget addStyleNames="{style.my-MyWidget}" />

or even

> <g:MyWidget addStyleNames="{myApp.my-MyWidget}" />

And, doesn't this syntax (which is compatible with the use of
{style.someStyle} in a .ui.xml

<ui:style> .... </ui:style> actually generate a CssResource auto-
magically?

So, if I want to apply a common style (say, to all tables no matter
where they appear) across my entire app (and say, some tables are
built on the fly in Java code, and some are built in UiBinder.ui.xml
resources, and say some are built in some "static" .html files) --
what do you suggest?

Seems you're saying if I want to declaratively apply the style in my
UiBinder.ui.xml (which I want to do), I would have to do this:

<ui:style>
@external my-MyWidget
</ui:style>

then I would reference using:

<g:Widget addStyleNames="{my-MyWidget}"/>

So, if I then wanted to say have some page being rendered as entirely
auto-generated via some servlet -- I'll have to use the technique you
mentioned here:

> define a CssResource whose *.css source is only made of an @external rule 
> listing the class names from your My.css that lives in your war directory,  
> so you have a CssResource interface based on a non-CssResource-aware 
> stylesheet (you'd have to inject the stylesheet into the page by other means 
> than CssResource::ensureInjected() though)

Have I got it now?

Cheers.

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

Reply via email to