You don't need to use external for everything..you can turn off css
class name obfuscation by using the configuration property
CssResource.style and setting it to "pretty" in your module xml and
that will do the same exact thing.
Add this to your module's xml file:
<set-configuration-property name="CssResource.style" value="pretty"/>
Also, I don't think you need to do the style element content swapping
if you're not required to do theme swapping without a page reload.
What I do is on basically the first line of my entry point I call a
method that reads the user's theme setting from a meta tag set in the
page (I have a jsp generating the page) - you could also read this
from the URL, or a cookie, etc. I then just pass the theme name into
a method which associates the theme name to a ClientBundle class, uses
GWT.create() the instantiate the ClientBundle, then calls
ensureInjected on the CssResources in my ClientBundle.
On Oct 27, 2:33 pm, Potate <sammyjiang...@gmail.com> wrote:
> Hi folks
>
> My goal is to support theme selections at run time. Here is what I'm
> planning to do. I have some questions and I'm also looking for
> comments and suggestions:
>
> - start with a builtin GWT theme (standard, chrome, or dark) by
> declaring <inherit> in .gwt.xml module file.
> - create .css files that override the default:
>
> @external gwt-Button;
> .gwt-Button { font-size:150% }
>
> - ship the css themes in a client bundle
> - create a style element at the end of <head>
> - swap its content using StyleInjector.setContents( styleElem,
> MyResourceBundle.theme1().getText() )
>
> questions:
>
> @external is required for all the .gwt-*. There is no way around it,
> is there?
> Is it slow to swap the content of the style element? If so, would
> swapping style's href be faster? How do I get the URL to the style
> sheets in the resource bundle?
>
> any comments & suggestions are welcome
>
> I'm using GWT 2.1 RC1
> thanks
--
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