Table of Contents

(Building Table of Contents...)

Skins in ZWC 5.0

About Skins

Skins, also known as themes, in the Zimbra Web Client (ZWC) are a combination of HTML, CSS and properties files that control the appearance of the ZWC application.

The skinning system allows you to easily change the appearance of ZWC, for example, to use the logo and colors of your company or institution. You can create many different skins to provide your users with choices for the appearance of the application, or you can restrict users to a single skin to enforce brand identity.

At a fundamental level, the skinning system all comes down to HTML and CSS files, since that is how the browser styles elements on a web page. The main purpose of the skinning system is to simplify working with the large number of CSS files in the ZWC app. We try to follow the DRY (Don't Repeat Yourself) Principle -- by specifying the appearance of the app logically and then making that work throughout the CSS. By changing a few settings, you can easily change many details in the ZWC's appearance.

What this means in practice is that your skin specifies a number of Skin Variables (in Skin Property Files) which are then compiled into the HTML and CSS files that make up the application.

The default ZWC installation comes with several themes, which you can use as the basis of your own themes. As of the time of this writing, they are:

You can use any of these themes as the basis for your own themes, and you can also download and install themes from the Zimbra Gallery.
Note that changes you make to the skin framework will not necessarily survive major upgrades to the ZWC product.

What can be customized

As a general rule, the following can be easily customized within the skin framework: With some advanced knowledge of HTML and CSS and a little work, the following can be customized:

What cannot be customized

There are a number of portions of the ZWC user interface that require a significant amount of Javascript coding to change. Customizing these things are beyond the scope of this document. See Getting Help for options on making changes to the above and anything else not covered in this document.

Audience Experience

This document assumes that you have a running installation of the ZWC application, are basically familiar with HTML and CSS, and are comfortable with routine tasks like running command-line programs.

See Getting Help for help in accomplishing these tasks if necessary.

Quick Reference

At it's simplest, creating a skin can mean just changing the colors of the application and possibly using a different logo for your company or institution. This section will walk you through that simple process -- for more detailed information please continue to read the rest of this document.

Creating a Simple Skin

We'll create a simple skin called "pumpkin" which is orange and brown.
  1. Find a ZCS skin that is similar to the one you want to customize. We'll assume that you're starting with the "sand" skin (one of the default skins shipped with ZWC 5.0).
  2. Locate the Skin Directory for the skin you want to customize. In our case, this will be .../zimbra/skins/sand/. (see Locating the Skin Files and Anatomy of a Skin for more info)
  3. Duplicate the entire skin directory and give it a new name. We'll use "pumpkin" as the name of our sample skin.
  4. Edit the file .../zimbra/skins/pumpkin/skin.properties with your favorite text editor. (see Skin Property Files).
  5. Change the "SkinName" variable to "pumpkin" (or whatever you called your skin -- this must be exactly the same as the name of the skin directory and the name is case sensitive).
  6. Pick new Skin Colors for the AppC, AltC and SelC Skin Variables:
    • AppC is the base color of the background and most of the application. The skin framework will automatically generate lighter and darker shades of this color to make a pleasing appearance for the application.
    • AltC is the base color for toolbars and highlighted buttons. If you want a single color (monochromatic) theme, you can leave this as @darken(AppC,20)@, which will be a darker shade of the AppC.
    • SelC is the highlight color for lists, such as the list of messages.

    For example, to create our pumpkin theme, we'll use the following values:

    New colors in our sample skin.properties file
    			AppC				=	#fec855
    			AltC				=	#ddbc76
    			SelC				=	#ffffcc
    			
  7. To change the logo for the application, create a folder called .../zimbra/skins/pumpkin/logos/ and place the following files in it. Transparent PNG images are encouraged for this (see Use of PNGs).
    1. LoginBanner.png, a PNG image sized at 450px wide by 100px tall that will be displayed in the "splash screen" shown when the application is loading.
    2. AppBanner.png, a PNG image sized at 120px wide by 35px tall that will be displayed in the upper-left corner of the application window.
    ZCS licensing rules govern who can change the logos and who must use the Zimbra logo, see Changing Logos.
  8. Change the LogoImgDir and LogoURL Skin Variables in your skin.properties file as shown below. Set LogoURL to the URL where you would like to send users when they click the logo graphic:
    Custom logos in our sample skin.properties file
    			LogoImgDir		= /zimbra/skins/@SkinName@/logos
    			LogoURL			= http://www.yourcompany.com
    			
  9. Use the zmskindeploy tool to install your skin. Type the following on the command line:
    			cd /opt/zimbra/jetty/webapps/zimbra/skins/
    			zmskindeploy pumpkin/
    			
  10. To test your new skin, add the url parameter "skin=<skinname>" to the normal URL you use to access ZWC:
    http://your.server.com/zimbra/?skin=pumpkin
That is all that you need to do to create a basic skin. You can stop here, or continue reading to learn much more about how the skin framework operates and how to change many more details of the application.

Anatomy of a Skin

A skin is nothing more than a set of text and/or image files that describe the appearance of the ZWC application. To create a basic skin, all you need is a text editor such as Notepad or TextEdit, although you will need a graphics program such as Adobe Photoshop or The Gimp to edit graphics.

All of the skins for your install of ZWC live inside the .../zimbra/skins/ directory, each skin in a separate sub-directory. For example, the "beach" skin lives in the directory .../zimbra/skins/beach/. We will refer to this below as the skin directory. See Locating the Skin Files for how to find this in your system.

Note that some skins reference files in other skin directories to avoid duplication of files -- in particular, many skins reference the .../zimbra/skins/_base/base2 directory, where the common files for most skins live.

A skin is composed of some or all of the following files:
File TypeExamplePurpose
Skin Manifestmanifest.xml tells the application which files comprise this skin
Skin Property Filesskin.properties the primary controller of the appearance of the skin
Skin CSS Filesskin.css (optional) overrides standard application CSS definitions
Skin HTML Filesskin.html (optional) used to lay out the Skin Zones
splash.html (optional) Splash Screen, shows when app first launches
Skin JS Filesskin.js (optional) provides custom javascript for the skin.
logo imageslogos/AppBanner.png
logos/LoginBanner.png
(optional) Logos for the splash screen and "banner" graphic at the top-left of the application. See Changing Logos.
custom icons and graphicsimg/... (optional) Custom images, for example, background graphics for the different skin zones or custom icons. See Applying Background Images and Changing Icons.
skin templatestemplates/widget.template (optional) Custom HTML templates for widgets or many application screens. See Working with Templates.
message filesmessages/ZmMsg.properties (optional) 'Messages' are labels and prompts that are shown in the application. See Working with Message Files.

Skin File Details

Skin Manifest

The manifest.xml file, called the skin manifest, is an XML file that describes the skin to the application code. Each file item in the manifest represents a file that will be loaded in as part of your skin. The containing elements (script, substitutions, etc) tell the application how to process each file as part of the skin.

Below is the manifest for the default beach skin:

File: /zimbra/skins/beach/manifest.xml
				
					
						
							../_base/base2/skin.properties
							skin.properties
						
						
							../_base/base2/skin.css
						
					  
					
						
						
							../_base/base2/skin.html
							../_base/base2/splash.html
						
					
					
						
							../../css/zhtml.css
						
					
				 
			
The manifest.xml file is divided into three sections: The different types of files are:
When you add a file to your skin, remember to add it to the manifest.xml file, or it will not appear when you load your skin!

Skin Property Files

Skin property files define skin variables that are used in the rest of the skin, for example in the HTML or CSS files.

You specify your skin properties file in your manifest like so:

property file section of a typical manifest.xml file
				
					
						...
						
							../_base/base2/skin.properties
							skin.properties
						
						...
					
					...
				
			
Note that this examples loads two properties files:
  1. the base properties file (.../zimbra/skins/_base/base2/skin.properties), which sets up most skin variables, and
  2. a custom properties file (skin.properties) in your skin directory, which overrides definitions in the base file as needed.
Most skins such as sand and lavender define only a few properties for colors, taking almost all of their variables from the base properties file -- most likely your skins will do this as well.

A skin properties file looks something like this:

A sample skin.properties file
				# I am a Property File Comment
				SkinName                    = MySkin
				SkinVersion                 = 2
				
				TreeColor                   = #f9f6f0
				TreeStyle                   = background-color:@TreeColor@;
				ToolbarColor                = @darken(TreeColor,30)@
				
				# Fix non-standard IE syntax
				#IFDEF MSIE
					DisabledOpacity         = filter:alpha(opacity=40);
				#ELSE
					DisabledOpacity         = opacity:0.4;
				#ENDIF
			
There are three types of lines in a skin properties file: The left-hand side of Skin Variables sets the name of the variable, while text to the right of the = sign specifies the value of the variable. The value of a variable can come wholly or in part from an expansion of another variable:

Also, note that it is possible to define the same variable more than once in two properties file, or even within the same properties file using Property File Directives -- in this case, the definition that is loaded last will "win" or override. This ensures that definitions in your skin will take precedence over the standard ones in the base properties file.

To see the skin variables which change the appearance of different parts of the application, see sections Skin Zones, Widget Appearance, Working with Fonts and Working with Images.

Skin Variables

Skin variables set up shorthand associations that can be used throughout other files in the skin mechanism. Each normal line in a property file creates a single variable of the form: name = value.

For a concrete example, say we wanted to set the background color for the Tree on the left side of the application, we'd set the following:

A sample skin.properties file
				TreeColor  =  #f9f6f0	
				TreeStyle  =  background-color:@TreeColor@;	
			
This creates two skin variables: TreeColor and TreeStyle. In any HTML, CSS or skin properties file that uses this skin, you can use the Skin Replacement @TreeColor@ as a shorthand for the value #f9f6f0 and @TreeStyle@ to mean background-color:#f9f6f9;.

Note in this example that the replacement value in TreeStyle has the TreeColor replacement in it -- this is a common pattern, to define a value once and then use it in other skin variables later within the same properties file.

The tree color would manifest in your application via a CSS file, in this case skin.css where a CSS definition would reference the TreeStyle variable:

A sample skin.css file
				...
				
				.skin_container_tree 	{	@TreeStyle@		}	
				
				...		
			
In this way, the skin variables in your skin.properties file directly affect the CSS files that ZWC serves to the users. See sections Skin Zones, Widget Appearance, Working with Fonts and Working with Images for info about using specific skin variables.

Why would you want to use skin variables, why wouldn't you just hard-code the value of #f9f6f0?

Looking again at the expanded example above, note that we define:

A sample skin.properties file
							...
							TreeColor                   = #f9f6f0
							...
							ToolbarColor                = @darken(TreeColor,30)@
							....
			

This indicates that the toolbars in the application should be a darker shade of the TreeColor defined above. The skinning system is set up so that you can change a couple of variables (TreeColor in this case) in the skin.properties file and have that change ripple out through the rest of the application. You are free to break this pattern as you like, for example if you wanted your Toolbars to be a shade of blue, you could define:

A sample skin.properties file
							...
							TreeColor                   = #f9f6f0
							...
							ToolbarColor                = #bccbd6
							....
			
You can have any value you like as long as the format of your Skin Variable matches that of the pre-defined one (e.g., if a color was specified, you specify a color, etc).

A few more notes on properties files:

  • White space around variable definitions is generally ignored.
  • Skin variable names are case sensitive -- @SkinName@ and @skinname@ refer to different variables.
  • You can have a variable definition cross more than one line by using the \ character at the end of the line, for example:
    						TreeStyle  =  background-color:@TreeColor@; \
    						              border:1px solid black;	
    					
  • There are two skin variables that you MUST define in your skin.properties file:

  • SkinVersion, which is the version number for your skin (which should currently always be set to 2).

  • SkinName which must exactly match the name of the directory the skin is in. e.g. if your skin is in .../zimbra/skins/PrettyBlue/, your skin.properties must have an entry: SkinName = PrettyBlue

    Everything else is really optional.
  • Skin Replacements

    Skin replacements are used througout the application CSS and HTML files to ensure that the skin looks attractive and consistent. Whenever in a HTML or CSS file you see the pattern @somename@, the application will automatically substitute the value defined in the skin.properties files for somename.

    Remember that Skin Variables can be defined more than once (e.g. in different files) and that the last occurance of the skin variable is the one that will be displayed. This ensures, for example, that your definition of a Skin Variable will override the one defined in the base properties file.

    Skin Functions

    To make skin variables more powerful, we have defined a number of skin functions that modify the value of other skin variables or literal values. Use these anywhere you would use a normal Skin Replacement.

    Note that a color variable below can be in any of the following forms:

    FunctionDescription
    @darken(color, percentage)@ Darkens color by specified percentage. Functon arguments:
    • color, as above.
    • percentage is a percentage to darken, expressed as a whole number between 0 (no change) and 100 (black).
    The returned value is a color of the form #xxxxxx, unless the color could not be interpreted, in which case the returned value will be Unknown color: <color>
    e.g. @Darken(#000000, 20)@ == #cccccc
    @lighten(color, percentage)@ Lightens color by specified percentage. Functon arguments:
    • color, as above.
    • percentage is a percentage to lighten, expressed as a whole number between 0 (no change) and 100 (white).
    The returned value is a color of the form #xxxxxx, unless the color could not be interpreted, in which case the returned value will be Unknown color: <color>
    e.g. @lighten(black, 20)@ == #666666
    @border(size, type, color)@ Outputs CSS to create a border that looks the same on different browsers. This is necessary because the CSS borders created by Internet Explorer and Firefox treat colors differently, making it impossible to do a simple CSS border that looks the same on both browsers. Also, this correctly handles "transparent" borders. Functon arguments:
    • size is size in pixels or ems, e.g. 1px
    • type is the type of border. Currently supported are:
      • solid
      • inset
      • outset
      • transparent
    • color, as above. Default is black if not specified.
    e.g. @border(1px,outset,#cccccc)@ or
    @border(1em,transparent)@
    @img(dir, name, width, height, repeat)@

    or

    @image(dir, name, width, height, repeat)@
    Outputs CSS to show an image as a background-image of an element. This is necessary to output semi-transparent .png images correctly in older versions of Internet Explorer. Functon arguments:
    • dir is the Skin Variable for the directory that the image lives in. Should be one of:
      • SkinImgDir : image directory for your skin
      • SkinAnimatedImgDir: directory of animated images
      • ImgDir: normal images used by the app (eg: icons, etc)
      See: Working with Images.
    • name is the file name of the image, relative to the dir.
    • width (optional) is the width of the image, in pixels.
    • height (optional) is the height of the image, in pixels.
    • repeat (optional) specifies whether the image should appear only once (no-repeat) or tile (repeat).
    e.g. @image(SkinImgDir, background.png, 100, 100, repeat)@ ==
    • in MSIE 5, 5.5 or 6:
      background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src='/zimbra/skins/MySkin/img/background.png' sizingMethod='scale'); width:100px; height:100px;
    • in other browsers:
      backround-image:url(/zimbra/skins/MySkin/img/background.png) repeat;
    @cssShadow(size, color)@ Outputs CSS to draw a shadow underneath an element. Currently only supported in Safari 3+ -- for other browsers, outputs nothing. Functon arguments:
    • size (optional), is size of the shadow. Default is "5px" if not specified.
    • color (optional), as above. Default is #666666 if not specified.
    e.g. @cssShadow(10px, red)@ ==
    • in Safari 3::
      -webkit-box-shadow:10px red;
    • in other browsers::
      nothing
    @roundCorners(size)@

    or

    @roundCorners(TL, TR, BR, BL)@
    Outputs CSS to round corners in a cross platform way. Works in Firefox and Safari 3+, does not work in Internet Explorer. Functon arguments:
    • size is size for all 4 corners,
      or
    • TL is size for top-left corner
    • TR is size for top-right corner
    • BR is size for bottom-right corner
    • BL is size for bottom-left corner
    For all of the above, size can specified in pixels (e.g. 3px) or as one of the contstants small (3px), medium (5px), big (10px) or huge (10px)
    e.g. @roundCorners(3px)@ ==
    • in Firefox::
      -moz-border-radius:3px;
    • in Safari 3::
      -webkit-border-radius:3px;
    • in Internet Explorer or other browsers::
      nothing
    @opacity(percentage)@ Cross-platform method to specify opacity (compensating for non-standard specification in MSIE). Function argument:
    • percentage is percent of opacity, expressed as a whole number between 0 (completely transparent) and 100 (fully opaque).
    e.g. @opacity(45)@ ==
    • in Internet Explorer::
      filter:alpha(opacity=45);
    • in Firefox, Safari and other browsers::
      opacity:.45;
    @cssValue(variable, property)@ Returns the value of css property: property of Skin Variable: variable.
    • variable name of a Skin Variable.
    • property name of CSS property to extract.
    e.g. with skin variable definitions:

        MyVar = font-weight: bold; background-color: red; color:white;

    cssValue@(MyVar, background-color)@ == red
    @css(variable, prop1, prop2, ...)@

    or

    @cssProps(variable, prop1, prop2, ...)@

    or

    @cssProperties(variable, prop1, prop2, ...)@
    Returns the entire definition of the CSS properties: prop1, prop2, etc of Skin Variable: variable. You can specify as many properties as you like.
    • variable name of a Skin Variable.
    • prop1 name of first CSS property to extract.
    • prop2 name of first CSS property to extract, etc.
    e.g. with skin variable definitions:

        MyVar = font-weight: bold; background-color: red; color:white;

    cssValue@(MyVar, font-weight, color)@
    == font-weight: bold; color: white;
    @cssText(variable)@

    or

    @cssTextProps(variable)@

    or

    @cssTextProperties(variable)@
    Returns the full text of all CSS text-related properties of Skin Variable: variable. This is the same as @cssProperties(variable, ...)@ with all of the following properties:
    • color
    • line-height
    • text-align
    • text-decoration
    • white-space
    • font
    • font-family
    • font-size
    • font-style
    • font-weight
    • font-variant
    e.g. with skin variable definitions:

        MyVar = font-weight: bold; background-color: red; color:white;

    cssText@(MyVar, font-weight, color)@
    == font-weight: bold; color: white;

    Note that the skin replacement function names are NOT case sensitive, so the following are all equivalent:

    Property File Comments

    Property file comments are provided in the skin properties file merely for human reference -- they are ignored by the skin mechanism.
    Comments must start at the beginning of a line -- the # character is allowed inside skin variables (for example, to specify colors like #fa873d).

    Property File Directives

    Directives provide instructions the skining mechanism. When the server is about to send skin files to the user, it looks at the user agent of the browser and customizes the CSS and HTML output as appropriate for that particular browser.

    This is useful because small differences in the way that browsers display web pages can mean that the same CSS will show different results in different browsers. This is a fallback which allows the skin designer to specify different behavior for each browser, rather than ripping their hair out.

    The meaning of the directives is as follows:

    The pre-defined variables you can test for are: Here's a simple example:
    					#IFDEF MSIE
    						ToolbarMargin		= margin:5px;
    					#ELSE
    						ToolbarMargin		= margin:10px;
    					#ENDIF
    				
    In this example, MSIE browsers will use a margin of 5 pixels, while all other browsers will use 10px.

    Note that the example above could also have been written like so:

    					ToolbarMargin           = margin:10px;
    					#IFDEF MSIE
    					    ToolbarMargin       = margin:5px;
    					#ENDIF
    				
    The first form presented (using the #ELSE branch) is preferred as it is clearer to see what is going on.

    If you need to do more than a simple #ELSE, nest two declarations:

    					#IFDEF MSIE
    					    ToolbarMargin           = margin:10px;
    					#ELSE
    						#IFDEF GECKO
    					        ToolbarMargin       = margin:5px;
    					    #ELSE
    					        ToolbarMargin       = margin:0px;
    					    #ENDIF
    					#ENDIF
    				
    In this example, MSIE will use 10px, GECKO will use 5px and other browsers (which, in practice generally means Safari) will use 0px.

    Skin CSS Files

    Skin CSS files are normal CSS files that will be run through the skin variable replacement procedure before they are served to the browser. Generally, the only items in a skin.css file should be: Most skins import the skins/_base/base2/skin.css rather than defining their own. To do this, the css section in your manifest should look like:
    excerpt from sample manifest.xml file with standard skin.css
    					
    						
    							...
    							
    								../_base/base2/skin.css
    							
    							...
    						
    						...
    					
    				
    If you need to have custom css for your skin, create a skin.css file in your skin directory, and update your manifest like so:
    excerpt from sample manifest.xml file with custom skin.css
    					
    						
    							...
    							
    								../_base/base2/skin.css
    								skin.css
    							
    							...
    						
    						...
    					
    				
    Note that you should almost always include the base skin.css file within your skin.

    Application CSS Files

    In addition to the custom CSS files for your skin, there are a number of other CSS files (called app CSS files) which the application automatically runs through the skinning mechanism and serves to the browser. They are all located in the .../zimbra/css/ directory.

    You do not need to do anything to include these files in your skin -- the appropriate ones are always used.

    A brief explanation of each:
    FilenameUsed for
    common.cssFiles common to many situations
    dwt.cssWidget styling (Buttons, Toolbars, etc)
    editor.cssHTML editor widget
    login.cssLogin (and splash screen) styles
    msgview.cssEmail message body styles
    spellcheck.cssSpell checker styles
    wiki.cssZimbra Documents (wiki) page styles when opened in a new window
    zhtml.cssStyles for the Standard (HTML) version
    zlogin.cssLogin (and splash screen) styles
    zm.cssStyles specific to the Zimbra Web Client application
    zmadmin.cssStyles specific to the Zimbra Administration application
    zmobile.cssStyles for the mobile-phone version of ZWC
    Note that you should avoid modifying these css files directly, as any changes to the files will not survive even minor upgrades to your ZWC installation. If you need to change a style that is defined in an app CSS file, copy that definition into your custom skin.css file and modify it there.

    Skin HTML Files

    There are two skin HTML files included as part of each skin:
    FilenameUse
    skin.htmlProvides structure to the application layout, directing the app where to put components like the Overview Tree and Mini-Calendar, as well as providing visual styling for these Skin Zones.
    splash.htmlProvides HTML for the Splash Screen, which is displayed to the user as the application is loading.
    In almost all cases, your skin will use the skin.html and splash.html files defined in the base directory (skins/_base/base2/) rather than defining your own. To use the base .html files, your manifest should look like so:
    excerpt from sample manifest.xml file with standard html files
    					
    						...
    							
    							...
    							
    								../_base/base2/skin.html
    								../_base/base2/splash.html
    							
    							...
    						
    						...
    					
    				
    If you wanted, for example, to use the standard skin.html file but want a custom splash screen, create the file splash.html in your skin directory, and edit your manifest.xml to look like so:
    excerpt from sample manifest.xml file with custom splash screen
    					
    						...
    							
    							...
    							
    								../_base/base2/skin.html
    								splash.html
    							
    							...
    						
    						...
    					
    				

    Custom Skin Layout

    If you do decide to customize the skin.html file, your best bet is to copy the base skin.html file (skins/_base/base2/skin.html) into your skin directory and modify that to do what you want. This is far simpler than creating a skin.html file from scratch, but be warned that it can still be a tricky process.

    Regardless of how you start, it is important to pay attention to a few rules:

    Don't forget to update your manifest.xml file to point to your new skin.html file, or it will not appear in your skin.

    Custom Splash Screen

    Customizing the splash screen is fairly easy, but you still may want to start with the base splash.html file (skins/_base/base2/splash.html) and modify that.

    There is just one rule to follow for your splash screen:

    Other than that, you can get as creative as you want.
    Don't forget to update your manifest.xml file to point to your new splash.html file, or it will not appear in your skin!

    Skin JS Files

    The skin.js file provides a bridge or Application Programming Interface (API) between the skin and the main application code of the ZWC. Each skin must provide certain javascript objects and functions that the application uses to manipulate the skin.

    If you are using the standard skin.html file, you should just include the standard skin.js file (skins/_base/base2/ZmSkin.js) from the base skin directory -- everything is set up properly. To use the standard skin.js file, your manifest.xml should look like the following:

    excerpt from sample manifest.xml file with standard skin.js file
    					
    						...
    							
    							...
    							
    							...
    						
    						...
    					
    				

    If you have a custom skin.html file, you might need to have a custom skin.js file. If you keep all of the same IDs for the Skin Zones as detailed below, you may be able to skip this step.

    If you do need to create a custom skin.js file, it is easiest to base your skin.js file on the standard one: to do this, create a new file .../zimbra/skins/YourSkin/skin.js and update your manifest.xml like so:

    excerpt from sample manifest.xml file with custom skin.js
    					
    						...
    							
    							...
    							<script>
    								../_base/base2/ZmSkin.js
    								skin.js
    							</script>
    							...
    						
    						...
    					
    				

    Note that the base skin.js file must come before your skin.js file.

    Detailing the Javascript code that you must include in your custom skin is beyond the scope of this document -- please Getting Help for more information on making javascript changes to your skin.

    Skin Zones

    The skin is conceptually divided into a number of zones, for example, the Overview Tree, the App Area, etc. The skinning mechansim makes it easy to customize the appearance of these zones. Make sure you read the next three sections (Skin Colors, Skin Containers and Logical Skin Zone Variables) to understand the way the skins are put together before you start changing things.

    Skin Colors

    Base Colors

    To make it easy to customize the colors in application, we define three "base" colors that are used to enforce a consistent look throughout the skin. The first thing to do when creating a new skin is to pick the following base colors -- all other changes will ripple out from that. For example, the only difference between the "beach" and "lavender" skins are changes to the base colors.

    Note that slightly lighter and darker shades of each of these colors are generated automatically (using the @darken(...)@ and @lighten(...)@ Skin Functions) to create a cohesive look in the skin.
    Skin VariablePurpose
    AppC Master color for the entire skin. Shades of this color are used as background and border colors for most of the Skin Zones.
    AltC Alternate color for the skin. Shades of this color are generally used for: Toolbars, Selected/highlighted buttons, etc.
    SelC highlight color for lists.

    Other Skin Colors

    Following is a list of other colors which are used to change various parts of the skin -- you generally will not need to change these colors:
    Skin VariablePurpose
    HilightColorBackground color for right-clicked items, drag and drop, selected item in a tree
    HilightColor-blurredBackground color for tree items when the tree does not have focus
    MatchedColorBackground color for items matched in a search (default is HilightColor)
    RightClickColorBackground color for right-click items (default is HilightColor)
    HeaderColorBackground color for headers, such as in the tree, above a list, etc
    InputBgColorBackground color for INPUT elements (text fields)
    WidgetBgColorBackground color for widgets such as Buttons and Selects
    SeparatorColorBorder color for separators between sections

    Skin Containers

    Here's a diagram of the zones of the "beach" skin. Note that some zones may typically be hidden -- for example, the ad zones, or the Advanced Search ("search_builder") zones are often hidden.


    (Enlarge)

    Each zone corresponds to an element (generally a DIV) in the skin.html file -- we call these "Skin Containers". Use the table below to map the names of the skin container elements to the Skin Variables that control them:
    Element IDs Skin Variables used Purpose
    Normal skin zones
    skin_outer SkinOuter Outer container of the skin itself
    skin_container_logo SkinBorderLogo Logo
    skin_container_search SkinBorderSearch Container for the search toolbar
    skin_container_web_search SkinBorderWebSearch Container for the web search toolbar
    skin_container_username SkinTextUsername Name of the current user
    skin_container_quota SkinBorderQuota Disk quota usage area
    skin_container_switch (none) Switch between Ajax and HTML clients link
    skin_container_help (none) Help button
    skin_container_logoff (none) Logout button
    skin_container_offline_status (none) Online/offline status indicator
    skin_container_search_builder SkinBorderSB "Advanced" search area
    skin_container_search_builder_toolbarSkinBorderSBToolbar Toolbar for Search Builder (now called "Advanced Search")
    skin_container_app_chooser SkinBorderAppChooser Application tabs (to switch between apps)
    skin_container_current_app SkinBorderCurrentApp Toolbar for the Overview Tree
    skin_container_app_top_toolbar SkinBorderAppToolbar Toolbar for the App Area
    skin_container_tree SkinBorderTree Tree of folders
    skin_container_tree_footer SkinBorderMiniCal Mini-calendar in the lower left side
    skin_container_tree_app_sash SkinBorderTreeSash Vertical bar that resizes the tree and application zones
    skin_container_app_main SkinBorderApp Main application area (switches based on current app)
    Ad containers -- see Working with Ads
    skin_container_top_ad AdStyle, TopAdHeight Space for a top "banner" ad
    skin_container_sidebar_ad AdStyle, SidebarAdWidth Space for a "skyscraper" ad to the right of the app
    skin_container_tree_top_ad AdStyle, TreeTopAdHeight Space for a small ad above the tree
    skin_container_tree_bottom_ad AdStyle, TreeBottomAdHeight Space for a small ad below the tree
    skin_container_bottom_ad AdStyle, BottomAdHeight Space for an ad on the bottom of the window
    Splash screen and login panel
    skin_container_splash_screen SkinOuter Background outside of the splash screen and login panel
    ZSplashPanel SplashOuterBorder Splash screen outer container
    ZSplashBodyContainer SplashOuterBorder Splash screen inner container
    ZLoginPanel LoginPanelOuterBorder Login panel outer container
    ZLoginBodyContainer LoginPanelInnerBorder Login panel inner container
    Deprecated
    skin_container_status status area (no longer shown)

    To customize a particular skin container listed above, create an entry for it's skin Variable in your skin.properties file and specify the CSS properties that you want for that zone. It is a good idea to start off with the definition of that skin variable in the .../zimbra/skins/_base/base2/skin.properties file.

    Most of the skin containers are defined in terms of the Logical Skin Zone Variables defined below -- you may find it advantageous to change these logical variables (which will affect many different zones) rather than change each zone individually.

    Also, note that if the base skin.properties file specifies a width and/or height for a particular skin zone, you should specify that as well or the skin may not lay out properly.

    For the skin variables named SkinBorder*, you can generally customize the following CSS properties:

    excerpt from sample skin.properties file with some customization of skin zones
    					...
    					SkinBorderSearch       = height:31px; background-color:pink; padding:5px; \
    					                         border:1px solid red; @roundCorners(5)@
    					                         
    					SkinBorderAppToolbar   = @ToolbarContainer@ background-color:pink; 
    					...
    				

    Note that the SkinBorderAppToolbar variable above is defined in terms of the ToolbarContainer replacement (see below) -- this is a common pattern. Placing the background-color entry after the ToolbarContainer replacement ensures that it will override any background-color set in ToolbarContainer.

    Logical Skin Zone Variables

    Most of the zones are defined in terms of the following Logical Skin Zone Variables -- this is where the skin variable mechanism really shines. By changing one of these "logical" variables, you can change many parts of the application.
    Skin VariablePurposeUsed in Skin VariablesCSS Properties
    ChromeBg The outer background for the entire application. Based on AppC. SkinOuter background-image
    PanelColor "Panels" are zones like the Tree, App, Mini-Calendar, etc. Based on AppC. (see PanelContainer) CSS color
    PanelBg Background for "panels". Based on AppC. (see PanelContainer) background-color or background-image
    PanelBorder Border for "panels". Based on AppC. (see PanelContainer) border
    PanelContainer Background and border for "panels". Based on AppC. TreeContainer, SplashOuterBorder, SkinBorderSearch, SkinBorderSB, SkinBorderTree, SkinBorderMiniCal, SkinBorderApp background, border
    ToolbarBg Background for toolbars. Based on AltC. (see ToolbarContainer) background-color or background-image
    ToolbarContainer Background and borders for main toolbars. Based on AltC. InlineToolbarContainer, SkinBorderSBToolbar, SkinBorderCurrentApp, SkinBorderAppToolbar, MiniCalHeaderBg, height (required), padding, background, border
    TreeHeaderContainer Background and border for tree headers. Based on HeaderColor. background, border
    PageBg Background for application "pages", such as tabs atop the Preferences screens, behind the Advanced Search section, etc. Based on AppC. WizardBg, SkinBorderPage, background-image or background-color
    PageHeaderBg Background and/or border for header section of application pages, eg message header. Based on HeaderColor. background, border
    PageHeaderText Text styling for page headers text and font properties
    ListBg Background color in list views. Based on AppC. background-color or background-image
    ListBorder Border for list views. Based on AppC. border
    WizardBg Background for wizards (mainly used in ZimbraOffline). Based on AppC. background-color or background-image

    Widget Appearance

    Widgets are controls such as Buttons and Selects that comprise the ZWC user interface.

    You can customize the color and border of most widgets in ZWC easily using the following Skin Variables.

    In addition to the normal appearance of each widget, you can control the appearance of the widget in the following states:
    StateMeaning
    normalWidget in its 'normal' state (e.g. not interacting with the mouse or keyboard)
    disabledWidget when it is not available to be used
    hoverWidget when the mouse is over the control
    activeWidget when it is being pressed
    focusedWidget when it has the keyboard focus
    selectedWidget when it has been 'selected', for example a selected tab or a row in a list that is selected
    sel-focusWidget that is both selected and focused (in list viewers only)
    defaultWidget that will be activated when the return key is pressed
    actionedWidget that is being right-clicked
    dragProxyWidget that is currently being dragged

    Logical Widget Variables

    In the normal ZWC skins, most widgets have more-or-less the same coloring and appearance. The following "logical" widget variables set the background and border colors for the following widgets:
    Skin VariablePurpose
    WidgetBgColorBackground color for most widgets
    WidgetBorderStyles applied to most widgets in all states
    WidgetBorder-normalStyles applied to widgets in their 'normal' state
    WidgetBorder-disabledStyles applied to widgets in their 'disabled' state
    WidgetBorder-hoverStyles applied to widgets in their 'hover' state
    WidgetBorder-selectedStyles applied to widgets in their 'selected' state
    WidgetBorder-activeStyles applied to widgets in their 'active' state
    WidgetBorder-defaultStyles applied to widgets in their 'default' state
    WidgetBorder-focusedStyles applied to widgets in their 'focused' state
    WidgetHeaderContainerStyles applied to most widget headers (e.g. headers of a list or tree)
    WidgetHeaderContainer-normalStyles applied to widget headers in their 'normal' state
    WidgetHeaderContainer-hoverStyles applied to widget headers in their 'hover' state
    WidgetHeaderContainer-selectedStyles applied to widget headers in their 'selected' state

    Widget Sizing

    The following Skin Variables control the sizing of various widgets:
    Skin VariablePurpose
    WidgetHeightHeight of widgets such as Select, Button, etc. Default is 20px
    ButtonHeightHeight of Buttons, ToolbarButtons. Default is 24px.
    TextButtonWidthMinimum-width of buttons that have text in them, for example, OK and Cancel buttons in a dialog. Default is 60px.
    ListItemHeightHeight of items in List views. Default is 18px.
    TreeItemHeightHeight and padding of tree items. Default is 18px.
    AccordionItemHeightHeight of Accordion items. Default is 24px
    SashSizeWidth or height of application sashes, e.g. between the list of messages and message view. Default is 8px.
    TextPaddingSizePadding around text. Default is 3px.
    PanelPaddingSizePadding around 'panels', such as the Tree, etc. Default is 10px.
    BoxPaddingSizePadding around 'boxes', or different sections of a skin zone. Default is 5px.
    BoxMarginSizeMargin around 'boxes'. Default is 5px.
    SmallBoxPaddingSizePadding around 'boxes' that are spaced closely together. Default is 2px.
    SmallBoxMarginSizeMargin around small 'boxes'. Default is 2px.
    SmallIconWidthWidth of normal icons, e.g. in toolbars.
    SmallIconHeightHeight of normal icons.
    BigIconWidthWidth of large icons, not frequently used.
    BigIconHeightHeight of large icons.

    Skin Variables for Specific Widgets

    Buttons

    Skin VariableUsage
    ButtonOuter styles for Button widgets
    ButtonBorderBorder class applied to Buttons in all states.
    ButtonBorder-normalBorder class applied to Buttons in "normal" state.
    ButtonBorder-disabled... in "disabled" state.
    ButtonBorder-hover... in "hover" state.
    ButtonBorder-active... in "active" state.
    ButtonBorder-focused... in "focused" state.
    ButtonBorder-selected... in "selected" state.
    ButtonBorder-default... in "default" state.
    ButtonTextText style applied to Buttons in all states.
    ButtonText-normal... in "normal" state.
    ButtonText-disabledetc.
    ButtonText-hover
    ButtonText-active
    ButtonText-focused
    ButtonText-selected
    ButtonText-default

    ToolbarButtons

    Toolbar buttons are simply buttons that appear in toolbars. They generally are transparent until rolled over by the mouse.
    Skin VariableUsage
    ToolbarButtonOuter styles for buttons in toolbars.
    ToolbarButtonBorderBorder applied to Toolbar Buttons in all states.
    ToolbarButtonBorder-normal... in "normal" state.
    ToolbarButtonBorder-disabledetc.
    ToolbarButtonBorder-hover
    ToolbarButtonBorder-active
    ToolbarButtonBorder-default
    ToolbarButtonBorder-focused
    ToolbarButtonBorder-selected
    ToolbarButtonTextText styles applied to Toolbar Buttons in all states.
    ToolbarButtonText-normal... in "normal" state.
    ToolbarButtonText-disabledetc.
    ToolbarButtonText-hover
    ToolbarButtonText-active
    ToolbarButtonText-default
    ToolbarButtonText-focused

    Selects

    Selects allow the user to choose one of a set of items, like a normal HTML <SELECT> element.
    Skin VariableUsage
    SelectOuter styles for all Selects.
    SelectBorderBorder applied to Selects in all states.
    SelectBorder-normal... in "normal" state.
    SelectBorder-disabledetc.
    SelectBorder-hover
    SelectBorder-active
    SelectBorder-focused
    SelectTextText styles applied to Selects in all states.
    SelectText-normal... in "normal" state.
    SelectText-disabledetc.
    SelectText-hover
    SelectText-active
    SelectText-focused

    Application Tabs

    Application Tabs appear above the main app area, and allow you to switch between applications. Note that their appearance ties in with the SkinBorderAppChooser variable.
    Skin VariableUsage
    AppTabOuter style for application tabs
    AppTabColorColor of application tabs when not selected (also used by SkinBorderAppChooser).
    AppTabSpacingSpacing between application tabs
    AppTabRoundCornersRound corners for top of app tabs when selected (Firefox and Safari only).
    AppTabBorderBorder applied to app tabs in all states.
    AppTabBorder-normal... in "normal" state.
    AppTabBorder-disabledetc.
    AppTabBorder-hover
    AppTabBorder-active
    AppTabBorder-focused
    AppTabBorder-selected
    AppTabTextText styles applied to app tabs in all states.
    AppTabText-normal... in "normal" state.
    AppTabText-disabledetc.
    AppTabText-hover
    AppTabText-active
    AppTabText-focused
    AppTabText-selected

    Tabs

    Tabs are normal tabs within the application, for example, in Preferences.
    Skin VariableUsage
    TabBarBackground style for tab bar, behind the tabs.
    TabBarPrefixStyles for space before the first tab in tab bar.
    TabBarSuffixStyles for space after last tab in tab bar.
    TabStyles applied to all tabs.
    TabSpacingSpacing between tabs.
    TabBorderBorder applied to tabs in all states.
    TabBorder-normal... in "normal" state.
    TabBorder-disabledetc.
    TabBorder-hover
    TabBorder-active
    TabBorder-focused
    TabBorder-selected
    TabTextText styles applied to tabs in all states.
    TabText-normal... in "normal" state.
    TabText-disabledetc.
    TabText-hover
    TabText-active
    TabText-focused
    TabText-selected

    ListViews

    Example ListViews are the set of messages in Email or the list of contacts.
    Skin VariableUsage
    ListContainerOuter container for a list view (such as the list of messages or contacts).
    ListHeaderContainerOuter container list headers
    ListColHeaderContainerColumn header for lists in all states.
    ListColHeaderContainer-normal... in "normal" state.
    ListColHeaderContainer-hoveretc.
    ListColHeaderContainer-selected
    ListColHeaderTextText styles of list column header in all states.
    ListColHeaderText-normal... in "normal" state.
    ListColHeaderText-hoveretc.
    ListColHeaderText-selected
    ListItemBgColor-normalBackground color for list items in "normal" state.
    ListItemBgColor-altBackground color for every other list item (alternating colors).
    ListItemBgColor-hoverBackground color for list item in "hover" state.
    ListItemBgColor-active... in "active" state.
    ListItemBgColor-matchedetc.
    ListItemBgColor-selected
    ListItemBgColor-actioned
    ListItemContainerBackground and border for list items in all states.
    ListItemContainer-normal... in "normal" state.
    ListItemContainer-altetc.
    ListItemContainer-disabled
    ListItemContainer-hover
    ListItemContainer-active
    ListItemContainer-matched
    ListItemContainer-selected
    ListItemContainer-focused
    ListItemContainer-sel-focus
    ListItemContainer-actioned
    ListItemContainer-dragProxy
    ListItemTextText styles for list items in all states.
    ListItemText-normalin "normal" state.
    ListItemText-altetc.
    ListItemText-disabled
    ListItemText-hover
    ListItemText-active
    ListItemText-matched
    ListItemText-focused
    ListItemText-selected
    ListItemText-sel-focus
    ListItemText-actioned
    ListItemText-dragProxy

    Trees

    Skin VariableUsage
    TreeItemBackground and border for tree item in all states.
    TreeItemTextText styles for tree item in all states.
    TreeItemSpacingSpacing between one tree item and the next.

    Accordion

    The Accordion allows the user to switch between sets of things, such as between different accounts. It is not seen by most users.
    Skin VariableUsage
    AccordionBorderOuter border for an accordion widget.
    AccordionItemBorderOuter border for an accordion button in all states.
    AccordionItemBorder-normal... in "normal" state.
    AccordionItemBorder-selectedetc.
    AccordionItemTextText for accordion button in all states.
    AccordionItemText-normal...in "normal" state.
    AccordionItemText-selectedetc.

    Menus

    Menus appear when buttons with a down arrow are pressed, or when right-clicking.
    Skin VariableUsage
    MenuContainerOuter border for the entire menu.
    MenuItemOuter styles for each menu item.
    MenuItemBorderBorder for menu items in all states.
    MenuItemBorder-normal... in "normal" state.
    MenuItemBorder-disabledetc.
    MenuItemBorder-hover
    MenuItemBorder-active
    MenuItemTextText styles for menu items in all states.
    MenuItemText-normalin "normal" state.
    MenuItemText-disabled...
    MenuItemText-hover
    MenuItemText-active
    MenuItemTextPaddingPadding around text/icons in menu item.
    MenuItemSeparatorSeparator within a menu.

    Tooltips

    Skin VariableUsage
    TooltipContainerOuter border of the entire tooltip.
    TooltipTextText for the tooltip.
    TooltipText-labelText for "labels" within the tooltip.
    TooltipArrowContainerStyles for the arrow of the tooltip.

    Links and Anchors

    Skin VariableUsage
    AnchorStyle for text anchors in all states.
    Anchor-hover... in "hover" state.
    Anchor-activeetc.
    Anchor-disabled
    Anchor-matched
    ZimletBgStyle for text matched as a Zimlet (e.g. a date in an email message) in all states.
    ZimletBg-Hover... in "hover" state.

    Inputs and Textareas

    Skin VariableUsage
    ZFieldBg-normalBackground color for text fields in "normal" state.
    ZFieldBg-error... in "error" state.
    ZFieldBg-requiredetc.
    ZFieldBg-focused
    ZFieldBg-disabled
    InputBorderBorder for text fields in all states.
    InputBorder-disabledBorder for text fields when disabled.
    InputFieldStyles for input fields in all states.
    InputField-normal... in "normal" state.
    InputField-focusedetc.
    InputField-error
    InputField-required
    InputField-disabled
    InputField-hint
    TextAreaStyles for text areas in all states.
    TextArea-normal... in "normal" state.
    TextArea-focusedetc.
    TextArea-error
    TextArea-required
    TextArea-disabled

    Mini-Calendar

    Skin VariableUsage
    MiniCalBgBackground of the entire mini-calendar.
    MiniCalHeaderBgBackground of the mini-calendar header.
    MiniCalHeaderTextText for the mini-calendar header.
    MiniCalDOWBgBackground for the "Day Of Week" section of the mini-calendar.
    MiniCalDOWTextText for the...
    MiniCalButtonStyles applied to mini-calendar buttons in all states.
    MiniCalButton-normal.... in "normal" state.
    MiniCalButton-hoveretc.
    MiniCalButton-active
    MiniCalButton-today
    MiniCalDay-hilitedMini-cal button when hilited (eg: appointments on that day).
    MiniCalDay-todayMini-cal button for today.
    MiniCalDay-wrongMonthMini-cal button for "wrong" month (eg: before start or end of displayed month).
    MiniCalDay-selectedMini-cal button for days displayed in the calendar view.

    Sliders

    Sliders are currently only seen in the Voicemail application, which is not seen by most users.
    Skin VariableUsage
    SliderStyles applied to the outside of the slider.
    SliderBorderBorder applied to horizontal and vertical slider.
    SliderThumbBorderBorder applied to horizontal and vertical slider thumbs (the part you drag).
    HSliderSizeWidth and height of a horizontal slider.
    HSliderBorderBorder applied to a horizontal slider.
    HSliderThumbSizeSize of a horizontal slider thumb.
    HSliderThumbBorderBorder of a horizontal slider thumb.
    VSliderSize(same as HSlider*)
    VSliderBorder
    VSliderThumbSize
    VSliderThumbBorder

    Windows

    Windows are dialogs (such as "New Folder") or windows in the Instant Messaging application.
    Skin VariableUsage
    WindowBgBackground color of windows.
    WindowContainerBorder and color of windows.
    WindowContainer-focusedBorder and color of window in "focused" state.
    WindowOuterBorderOuter border for application "windows" such as dialogs, based on AppC. Normally fairly dark, to be visible on top of the application.
    WindowInnerBorderInner border for dialog windows.
    LightWindowOuterBorderOuter border for different colored window. Based on AltC
    LightWindowInnerBorderInner border for different colored window.
    WindowTitleTextText styles for all window titles.
    WindowTitleText-normalText styles for normal window titles.
    WindowTitleText-lightText styles for "light" window titles.

    Working with Fonts

    All fonts used by the application are set with the following skin variables. The main ones you might want to change are FontFamily-default, Fontsize-normal and Text (to set default text color).
    Skin VariableUsage
    FontFamily-defaultDefault font family for the entire app.
    FontFamily-fixedDefault font family for fixed-width situations (like text-only email messages).
    FontFamily-htmlDefault font family for HTML-edit situations.
    FontSize-normalFont size for most text in the app. Default is 11px.
    FontSize-bigFont size for text that is slightly bigger. Default is 13px.
    FontSize-biggerFont size for text that is bigger still. Default is 15px & bold.
    FontSize-biggestFont size for text that is really bigger. Default is 18px & bold.
    FontSize-smallerFont size for text that is slightly smaller than normal. Default is 9px;
    FontSize-minisculeFont size for text that is incomprehensively small. Default is 6px.
    FontSize-htmlFont size for HTML editing.
    TextNormal text.
    LabelText labels (eg: before a text field).
    Label-wrapText labels that should wrap.
    Label-lightText labels in a light context.
    Text-lightLighter text.
    Text-requiredText for a required field.
    Text-disabledDisabled text.
    Text-contrastText color in contrasting situations (like window titles)
    Text-hoverText when hovered over.
    Text-activeText when being clicked.
    Text-selectedText when selected.
    Text-defaultText for default buttons.
    Text-focusedText for focused widgets.
    Text-todayText for today (in mini-calendar and calendar views).
    Text-unreadText for unread messages.
    Text-deletedText for deleted messages.
    Text-importantText for important things.
    Text-errorText when in an error state.
    Text-successText when something succeeded.
    Text-matchedText for things that matched a search.
    Text-hintText for hints in text fields.
    Text-anchorText for all links.
    Text-anchor-hoverText for links in "hover" state.
    Text-anchor-activeText for links in "active" state.
    Text-anchor-disabledText for links in "disabled" state.

    Helpful Skin Variables

    Skin Borders

    The following border variables are defined based on the Base Skin Colors. Use these to provide attractive borders within skin zones, in widgets, etc.

    Skin VariableUsage
    TransparentBorder "Border" used for a widget, etc when you don't want a border to show up initially, but will be showing a border on hover, etc.

    For example, used in Toolbar Buttons so the buttons don't 'jump' when a border is shown on hover.

    NormalOutsetBorderNormal outset (raised) border based on the AppC variable.
    MediumOutsetBorderSlightly darker outset border based on AppC.
    DarkOutsetBorderVery dark outset border based on AppC.
    NormalInsetBorderNormal inset (lowered) border based on AppC.
    MediumInsetBorderSlightly darker inset border based on AppC.
    DarkInsetBorderVery dark inset border based on AppC.
    AltOutsetBorderNormal outset border based on AltC.
    AltInsetBorderNormal inset border based on AltC.
    SelOutsetBorderNormal outset border based on SelC.
    SelInsetBorderNormal inset border based on SelC.
    DisabledBorderBorder for a disabled widget, based on AppC.
    DefaultBorderBorder for a default widget -- the widget that will be activated by the return key.
    FocusBorderBorder for a focused widget -- the widget that has keyboard focus.
    DragBorderBorder for something being dragged in a drag-and-drop operation.
    FieldBorderBorder for an input field.
    SmallTransparentBorderTransparent "border" for use in the Mini-Calendar.
    SmallOutsetBorderOutset border for use in the Mini-Calendar (based on AppC).
    SmallInsetBorderInset border for use in the Mini-Calendar (based on AppC).

    Working with Images

    Images in ZWC

    In general, images in ZWC are specified with CSS as background-images, and for efficiency, many images are merged together into "sprites", such as the image to the right. The merging of images and the generation of the appropriate CSS classes is accomplished automatically by the ZWC server.

    Images are specified within the ZWC app with a CSS class name that is the same as the name of the image (minus the .gif or .png extension). So an image named: ImgRightArrow.gif will correspond to the CSS class name ImgRightArrow. The consequence of this mapping of image name to CSS class means that there can only be one image of any given name used within the system. The advantage of this is that it is easy to override any image that is used within the application -- you simply add another image of the same name to your skin.

    All images in your skin should go in a directory named img/ inside your skin directory: .../zimbra/skins/YourSkin/img/. We'll refer to this below as your skin image directory. The skin variable SkinImgDir will automatically reference this directory.

    To add an image to your skin:

    1. Create the image as a PNG or GIF image. (See Use of PNGs). If you are replacing a pre-existing ZWC image, make sure your image has exactly the same name as the original image.
    2. Create your skin image directory, as above, and place the image in it.
    3. Deploy Your Skin
    See Merging Images for more information on efficiently serving images via CSS.

    Applying Background Images

    If you want to assign an image to the background of one or more Skin Containers, you can use the @image()@ Skin Function. For example, if you have created an image for the background of the entire application, you will want to assign it to the ChromeBg Skin Variable.
    1. Create your image as a .gif or .png file, choose a name (we'll use ChromeBg.gif) and save it in your skin image directory (e.g. .../zimbra/skins/YourSkin/img/ChromeBg.gif). Note that this is an arbitrary name, but naming the image the same as the Skin Variable it will be used by can make things clearer.
    2. Edit your skin.properties file (.../zimbra/skins/YourSkin/skin.properties), and add an entry for the ChromeBg skin variable, as shown below.
    3. Deploy Your Skin.
    your skin.properties file with a custom background image
    					...
    					ChromeBg		= @image(SkinImgDir, ChromeBg.gif, 100%, 100%, repeat)@
    					...
    				

    Changing Logos

    It is easy to customize the logo that appears in the login/splash screen, as well as the logo "banner" that appears at the top-left of the application. To change the logos, put the appropriate variables in your skin.properties file and create your logos as specified below.

    Note that there are legal rules for who may customize these logos, as detailed below and at this site: http://www.zimbra.com/partners/trademark_branding_faq.html

    Changing Icons

    To override any icon in the ZWC application, simply create an image with the same name as the default Zimbra image (which can all be found in the image directory: .../zimbra/img/) and place it in your skin image directory. After you Deploy Your Skin, the new image should be visible. (You may need to clear your browser cache if it is not visible).

    Note that you want to override one of the individual images, which should start with Img -- these images are generally in subdirectories of the image directory, eg: .../zimbra/img/arrows/ImgNextPage.gif. The large images such as arrows.gif are merged images which are generated automatically -- see Merging Images below for more information on this process.

    Note that it is a good idea for you to create your images at the same size -- generally, 16 x 16 pixels -- as the original Zimbra image. If you do not, things may not line up properly. You do not need to put your images in the same directories as the original Zimbra images.

    Merging Images

    The ImageMerge process is how the ZWC server makes sure that images are served as efficiently as possible. When you Deploy Your Skin, the imagemerge process will be run automatically. See below for how to create your images so they can be merged properly.

    Naming Images to be Merged

    In general, the name of each image will be the name of the CSS class that will display the image, so an image named ImgNextPage.gif will generate the CSS class of ImgNextPage.

    Most images are set to not repeat -- that is, the image should only show up once, even if the HTML element that displays it is larger than the image size. If you want an image to tile, or repeat, you indicate this by saving the image with a special name:

    Note that the default behavior is that all images in each sub-folder of your skin image directory will be merged together. So if you have two folders in your image directory, you will end up with two merged images. This is for efficiency -- combining images is generally a good idea, but the bigger the combined image the more memory it will take up in the browser when it is used over and over. A couple of notes on image directories: