Friday, April 24, 2015

Re: LESS/ SASS/... style usage in GWT ?

Cool, but sometimes CSS is not about just colors !

You may want to change the structure of the CSS between themes. For example one theme would have the checkboxes styled so they look as iOS ones (through some known CSS tricks with ::content and so on) and other times you might want them to appear in another way.

So it's not just a matter of injecting a color value... It's matter of completely changing the CSS structure.

In that case, how would you do with CssResources ?

Thanks, i like this discussion !

Arnaud

Le ven. 24 avr. 2015 à 22:17, Jens <jens.nehlmeier@gmail.com> a écrit :
I would probably just serve the CSS using a servlet that fetches the CSS from database based on the current customer. The app would then have a small UI to update the CSS in the database.

If you don't need to give customers full control but just want to allow them to change logo / colors then I think you can also use CssResource runtime evaluation. That is you would define

@def APP_BACKGROUND_COLOR eval("com.example.app.client.resource.Branding.getBackgroundColor()");

and then use APP_BACKGROUND_COLOR throughout your CssResource styles. To make Branding.getBackgroundColor() return the correct value for a given customer you would load that information from your server and set it on the Branding class before you inject the CSS. In your app UI you would then have a simple text box where customer can change the CSS hex color.


-- J.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/mrBctJ2BGtI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment