Friday, April 24, 2015

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

Hi Jens,

True that HexaCss allows for theme switching, but it is only a side effect of what it really allows : to have multiple css files bound to the same gwt application, without needing to recompile the application.

For example, you might want to rebrand your application for another customer, you might want to generate css on the fly according to some user preference, and so on.

There are other advantages. For instance, i saw many of my customer's projects were each widget has one CssResource interface associated and one corresponding css file. This leads to a lot of little css files scattered accross the project. With HexaCss, you can still have one java interface by widget, which is cool from the point of view of object oriented programming. And then you can make up bigger css files having each one cover several java interfaces. For example one CSS file for each of the three main packages of your application...

Also, what you can do : for instance imagine you are using an external GWT library. If this library uses CssResource, you will have hard time customizing its css. But if it uses HexaCss, you just have to provide a CSS file, run the maven plugin on it and you are done ! No need to make some CssResource inheritance mechanism to insert your own CSS. You don't have to entangle too much the CSS concepts and the Java architecture concepts.

There may be many more use cases, i found myself discovering new ones often. The first one was not having to recompile the application when chaning the css files.

In one word, what this tool does is to decorrelate the CSS use from the Java GWT compilation.

- The first phase of the tool does an analysis of your Java HexaCss interfaces to generate a consistent naming accross compilations.
- Then the maven plugin uses the information produced during the GWT compilation to transform your css files (generated with less, sass, gss or not) so that they are optimized and bound correctly to your application.

I am not sure i am really clear in my explanation, but i hope you get the idea... So the theme switcher is for me really just a way to show that the GWT compilation is decorrelated from the CSS binding, which is the essence of this tool.

Thanks !

Arnaud

Le ven. 24 avr. 2015 à 20:08, Jens <jens.nehlmeier@gmail.com> a écrit :

With HexaCss for GWT, you can use Sass, Less, Susy, Foundation, Bootstrap and so on. For the programmer you use it the same kind of way as CssResource/ClientBundle, but then you bind your application to external CSS files, and thus can use any CSS Framework. You should have a try !

This is what i use to quickly wrap an existing CSS Framework (bootstrap, skeleton, ...) or to use my own Less or Sass or GSS stylesheet


That might be a dumb question but:

If I don't need theme switcher support then HexaCss doesn't really add any value or does it? I mean I can just generate/use a css file from any css framework / css preprocessor and then create a matching CssResource for its content. Then GWT will do the rest.

So it seems to me that HexaCss is just about dynamic themes while still having some css pruning and minification?


-- 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