On 27 avr, 15:19, Mike <[email protected]> wrote:
> I have a similar question:
>
> I was quite intrigued to see the @external annotation here -- anyone
> point at more documentation?
> All I found was
> this:http://code.google.com/p/google-web-toolkit/wiki/CssResource#External...
>
> From that documentation, it seems to imply only that the generated
> CssResource will not be obfuscated, and one can still gain
> programmatic access to the name.
>
> 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".
> Is it possible to have a single <module>.css file defined that would
> allow the one to combine the following techniques:
> - use in .ui.xml (I think that the answer is basically yes, use
> <ui:style @src="My.css"/> <g:Widget addStyleNames="{style.someStyle}"/
>
> - use in .java classes
> - use in .html resources (files included in the war directory)
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".
> So -- I guess I'm really looking for some way to get something like
> this to work: <ui:style @src="<some path>/war/My.css"/>
>
> Any suggestions / comments on this?
Why not just use the class names instead of trying to make it fit into
a CssResource? (<g:MyWidget addStyleNames="my-MyWidget" />)
Otherwise, you could define a CssResource whose *.css source is only
made of an @external rule listing the class names from you 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)
--
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.