Friday, April 29, 2011

Re: Many injections of same css

Using <ui:style src="..."/> you're creating a new CssResource (each time) with @Source("resources/global.css"). The rules in global.css are processed for each CssResource and generate different obfuscated class names (this is important as each CssResource could add other rules for the same class names, and you wouldn't want conflicts between your CssResources).
If you want to share definitions, you should use a single CssResource, either one that you reuse (e.g. include in a ClientBundle, and then use that bundle using <ui:with> in UiBinder), a @Shared one that you inherit from (use <ui:style type="..."/> to point to it or an interface that extends it), or an @ImportedWithPrefix CssResource that you then @Import in another CssResource (or <ui:style import="..."/> in a UiBinder template).

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

No comments:

Post a Comment