In a well designed app, there are no widget-specific styles. None. Every margin / padding / color / size / border , etc., should be defined by a designer at the application level. I can't think of any style that developers should be allowed to set as they wish. It makes it much easier to build beautiful, professionally designed apps, that can be: * easily themed * adjust to various screen sizes gracefully * support multiple font sizes (CTRL +/- in every browser) and UI languages * look correctly in all browsers.
In my GWT app users can change the theme of the app with a single click. The app does not reload, but it immediately looks very different - including the color of rows in every DataGrid! This implementation requires 1 line of code. Can you beat that with a ClientBundle? All the magic is done by a designer in an external CSS file. I can add custom themes for premium customers by injecting a different CSS file at run time, without touching any GWT code at all. This also means that I never have to recompile the app when I make style changes. I also develop faster: when I add a new widget, it always looks right and it aligns perfectly with the other widgets in the same view. I don't have to decide its size or margins - they are handled by CSS. The only exception are LayoutPanels, where I have to set positions explicitly. To achieve all this, I had to merge GWT's standard theme with my own CSS file and externalize all DataGrid styles. I eliminated over 1,000 lines of CSS in the process, and by doing so I eliminated the conflicts they have been causing and made it much easier to maintain the app going forward. CSS is built around inheritance. If you create separate resources for each widget, or inline styles in widgets, or obfuscate styles at a widget level, you inevitably write much more CSS then necessary. Redundant code is always bad, but in this case it also greatly increases the possibility of inconsistencies and rule conflicts. I don't know any professional web designer who advocates inlining of styles or using multiple CSS files. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
