[Logo] IT Mill Toolkit Forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Feature request: Simple browser based theming  XML
Forum Index -> Themes
Author Message
Anonymous



Could you add browser info to main div?

Example:
<div class="i-app myTheme ie ie6"> or <div class="i-app myTheme gecko firefox2">, etc..

This way developers could make browser specific themes:
Code:
 /** default */
 .myTheme .i-myComponent {
    padding-left:3px;
 }
 /** overridden for ei6 */
 .myTheme.ie6 .i-myComponent {
    padding-left:5px;
 }


Thoughts?
Marko Grönroos



Joined: 23/07/2007 15:34:05
Messages: 75
Offline

Anonymous wrote:
Could you add browser info to main div? 

Hi,

The following code determines a browser and adds the corresponding style name to the main window object.
Code:
         // 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.
Anonymous



To keep this in mind, there's now an enhancement request ticket: http://dev.itmill.com/ticket/1660.
 
Forum Index -> Themes
Go to:   
Powered by JForum 2.1.7 © JForum Team