Feature request: Simple browser based theming

Could you add browser info to main div?

Example:

or
, etc..

This way developers could make browser specific themes:


/** default */
.myTheme .i-myComponent {
   padding-left:3px;
}
/** overridden for ei6 */
.myTheme.ie6 .i-myComponent {
   padding-left:5px;
}

Thoughts?

Hi,

The following code determines a browser and adds the corresponding style name to the main window object.


        // Get the client identification string
        WebApplicationContext context2 = (WebApplicationContext) getContext();
        String browserApplication = context2.getBrowser().getBrowserApplication();
        
        // Add a browser-dependent style name for the main window
        if (browserApplication.indexOf("Firefox/2") != -1)
            main.addStyleName("firefox2");
        
        // Display the client identification string
        main.addComponent(new Label(browserApplication));

We try to avoid such browser-dependent styling and make the default style sheets as browser-independent as possible, so we would not like to add such code unless there is a clear need. It’s not very hard to do by youself anyhow, as was done in the above example, and you can do it easily for the specific browsers for which you make the custom styling.

To keep this in mind, there’s now an enhancement request ticket:
http://dev.itmill.com/ticket/1660
.