Chapter 15. Creating Your Own Theme

Firefox uses themes to change the look and feel of its interface with the user. You can either download themes or create your own themes. Themes and skins are both terms for changing the look and feel of a program. An example of using skins is the Windows Media Player.

In this chapter you will create a theme. Not a complete, ready-for-the-public version (to do that we’d have to dedicate most of the book to themes), but a theme that performs some formatting changes.

Theme creation is only a bit harder than modifying userChrome.css, allowing you to make Firefox’s browser window look the way you want.

Note

All the files described in this chapter can be downloaded from the book’s website at http://www.quepublishing.com/title/0789734583.

Preparing Your Theme

To create a theme, you have several tricks of the trade that you can employ to help you get started. Some of these are mandatory, and some are just highly recommended. The next few sections give you the basic setup for a new theme.

One thing you will do is to copy an existing theme. You could copy virtually any theme, but one of the best starting points is the Firefox default theme that is installed with Firefox.

Open your favorite text editor. WordPad works for text editing, but there are better choices. A graphics editor is necessary, as well. The graphics editor must support transparent background graphics (which rules out Windows’ Paint program). A visit to http://www.sourceforge.net will lead to many examples of both text and graphics editors.

If you did not install the DOM Inspector when you installed Firefox, do so now (installing Firefox again and selecting the DOM Inspector is the easiest way to do this). It is a useful tool for theme developers.

Creating the Working Theme

First, if you are using a theme other than the default theme, start Firefox and select the Firefox (default) theme. Then close Firefox, restart it, and ensure that the default theme is active.

Themes are contained in JAR files when they are distributed. However, that format is awkward to use while developing and testing your theme. Instead, a theme can be created in a directory structure using folders and files.

To create this working folder, you will need a JAR file unpacker. Three programs that will do the job are TUGZip, Ultimate Zip, and WinZip. Windows XP’s built-in Zip file functionality does not seem to work with JAR files.

Firefox’s themes are stored in the Firefox installation folder (usually program filesmozilla firefoxchrome). In this folder you will find at least one JAR file, named classic.jar. This is the default theme for Firefox. There might be more JAR files in the chrome folder, especially if you have installed a number of themes already.

After opening the classic.jar file, create a new folder in Firefox’s chrome folder. I suggest naming it classic, at least for your first theme.

Now extract all the files in the classic.jar file into the classic folder. Make sure you keep the JAR file’s folder/directory structure. This will create a number of files and subfolders under your classic folder.

Tip

If possible, you should start developing themes with a new installation of Firefox and a new profile. Doing this keeps your Firefox installation as simple and uncluttered as possible. After you have more experience developing themes, you can consider using an installation of Firefox that is more customized.

After the theme has been extracted, close your unpacking program (WinZip, TUGZip, or whatever you used). This is important: Copy the classic folder (with all of its contents) to a backup location. I chose the name classic_backup and placed that backup folder in my Firefox chrome folder. This leaves you with a copy of the original files should you irreparably damage any file.

This leaves you with classic.jar, a new folder (with files and subfolders) called classic, and a backup of the classic folder called classic_backup.

Next, make a backup copy of the file named installed-chrome.txt. You will be modifying the original file, and after you want to restore the original settings, you will have a copy for that purpose.

Edit your installed-chrome.txt file using a good text editor. I use WordPad, but if you have a favorite text based editor, use it.

With the installed-chrome.txt file open, search for the string classic.jar. You will find about five occurrences of this filename in the installed-chrome.txt file. Each occurrence needs to be changed. (A safety check is that each of these lines should start with the word skin.)

Originally the line that must be changed was

skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/browser/

You should change each line to read:

skin,install,url,resource:/chrome/classic/skin/classic/browser/

There are two changes to make in each line. First, locate the characters jar:resource: and change them to read resource:. That means you must delete the jar: part. Next, find classic.jar! and change that to classic (or whatever folder you extracted the files and folders to earlier). In this edit, you are deleting .jar!— don’t forget to delete that exclamation point, too. This change tells Firefox that the theme won’t be packaged in a JAR file.

After you have changed all the lines that contain classic.jar as described, save this file and close your editor.

Finally, test your work. Open Firefox, and it should look exactly like it did before. If you notice differences, you have made an error; close Firefox and find what went wrong.

Configuring Firefox for Theme Development

Firefox is almost ready to develop themes; only a few more changes are necessary. Start Firefox and open about:config. You need to disable the XUL cache so that your changes will become immediately visible without having to restart Firefox. The XUL cache is used to cache the user interface, improving performance because Firefox does not have to deal with the JAR file each time the theme is needed.

The preference you need to set is

nglayout.debug.disable_xul_cache

Set this preference to true. (Don’t forget to reset it to false when you’re finished creating your theme; otherwise, Firefox performance will suffer.)

One final setup is to ensure that there is no userChrome.css file. Anything in userChrome will override the theme’s settings. You do not want settings in userChrome.css to affect the results of your theme development!

Tip

Check your user.js file and make sure there is not a setting for nglayout.debug.disable_xul_cache that sets the preference to false. This would override any other settings of this preference.

Graphics Images

Each theme consists of many Cascading Style Sheet settings that control size, color, shape, font, and so forth. Also set in CSS are the theme’s background and button images.

Menu, Toolbar, and Dialog Box Backgrounds

Background images generally are one of the following:

  • Browser background

  • Toolbar/menu background

  • Dialog box header background

This list is not exhaustive, and you will probably use the same background for several purposes.

The theme I am working on will give a wooden appearance to Firefox. To start with, I took several pieces of wood and created digital images of them. Using a graphics editor, I resized each image to fit the needs of my theme. When finished, I had created four images. Eventually, I will probably create another four or five wood-based images.

Button Images

Button images need to be created for both small buttons and large buttons. The background needs to be transparent so the toolbar background will show through the button as needed. Buttons that are disabled can be made with a transparent background and a semitransparent face, so that only a ghost of the button image shows.

Initially start with the existing button image files. Each image file usually contains many button images, which are then indexed for display. Figure 15.1 shows a sample button image.

Space for four rows of 15 images exist in this image, but the bottom row is not fully utilized.

Figure 15.1. Space for four rows of 15 images exist in this image, but the bottom row is not fully utilized.

Creating Themes

At first, creating a theme might seem to be a daunting task, but it is really not that difficult. To create themes, you need to know about a few standards such as CSS, be able to create icons and other graphics images, and know some basics of XML.

I will not try to minimize the amount of work it takes to create a theme. It is not a trivial, do-it-in-an-afternoon type of job. In fact, it could take weeks or months before your theme is complete enough for distribution. But it can be done—others do it, and so can you.

I do not recommend creating themes from scratch, especially for your first theme. Instead, you should start with Firefox’s existing classic theme. You do the preparation as described previously in “Configuring Firefox for Theme Development,” and start by modifying simple aspects of the theme. This will give you some experience in how the parts of the theme relate to each other.

The classic theme has the following folder structure:

  • skin—The skin folder is the folder that serves as the theme’s container. There is one folder in skin, named classic.

  • skinclassic—This folder contains four subfolders: browser, communicator, global, and mozapps. The most important folder for your theme is browser.

  • skinclassicrowser—Contained in this folder are the main CSS files, some image files, and two subfolders (bookmarks and pref).

  • skinclassicrowserookmarks—This contains theme elements dealing specifically with bookmarks. You will probably find two CSS files and the bookmark’s toolbar button image file.

  • skinclassicrowserpref—The pref folder holds style objects for the Tools, Options dialog box, buttons for the major categories (General, Privacy, Web Features, Downloads, and Advanced), and the pref.css file.

  • skinclassiccommunicator—This folder contains a subfolder named cookie and two other files.

  • skinclassiccommunicatorcookie—In cookie are toolbar images for cookie management and a taskbar button image.

  • skinclassicglobal—The global folder is the heart and soul of a Firefox theme. Virtually everything that might be set is done in global. It contains 11 subfolders (listed next) and many image and CSS files.

  • skinclassicglobalalerts—In this folder is the alert.css file. This CSS file describes the alert box.

  • skinclassicglobalarrow—This contains up arrows, down arrows, left arrows, right arrows, and arrows of many styles. These are all image files; there are no CSS files in this folder.

  • skinclassicglobalcheckbox—Items (typically menu items) that are checked are marked with the check image files contained in this subfolder.

  • skinclassicglobalconsole—These items are used by the JavaScript console. This folder typically has a console.css file and some image files.

  • skinclassicglobalicons—Contained in this folder are various icons and images that are used for warnings, and general control buttons (such as the Close button).

  • skinclassicglobalmenu—This folder contains menu item–related images. There can be toolbar-related items here as well.

  • skinclassicglobal adio—Radio button (sometimes called option buttons) images for checked and not checked are located here.

  • skinclassicglobalscrollbar—This has scrollbar images and usually one image for the slider.

  • skinclassicglobal hrobber—Contains throbber images, a minimum of a small throbber image. (The throbber is the image at the right end of the menu bar.)

  • skinclassicglobal oolbar—This folder might contain several toolbar-related, special-purpose images.

  • skinclassicglobal ree—Contains images used with tree views, such as in the DOM Inspector’s window lists.

  • skinclassicmozapps—The mozapps folder holds about eight subfolders, described next. There might also be a contents.rdf file.

  • skinclassicmozappsdownloads—Contains images, CSS files, and other files related to downloading and the Download dialog box.

  • skinclassicmozappsextensions—Contains images, CSS files, and other files related to extensions and the Extensions dialog box.

  • skinclassicmozappshelp—The Firefox help system styles are contained in this folder, as are a number of CSS files and images.

  • skinclassicmozappspref—Contains miscellaneous files, check images, dot images, and the pref.css file.

  • skinclassicmozappsprofile—The Profile Manager CSS files and images are found in this folder.

  • skinclassicmozappsshared—Contains richview.css and some related images.

  • skinclassicmozappsupdate—In this folder are images and the update.css file, which is used as part of the Firefox update system.

  • skinclassicmozappsxpinstall—Contains images and the xpinstallconfirm.css file. The XPInstall system is Firefox’s cross-platform installation system.

Classic

The Classic folder is the home folder for your theme. It contains files and subfolders. Eventually, you will package this folder into a distributable JAR file.

Usually four files can be found in the root of the theme’s JAR folder.

Each of the four files in the JAR root needs some modification. You can start by modifying the RDF files first. That creates a new theme in name only—the actual look and feel will mimic the original theme. After the RDF files are modified the way you want, change the icon.png and preview.png files.

After the root folder files have been updated, it is only necessary to move through the remaining files and subfolders and update the CSS and image files as appropriate. Now, if you work carefully, you should have a theme that reflects what you wanted. Your first try might not be as good as you want, but now you have experience and a much better understanding of what makes up a theme.

The root folder files you need to update are discussed in the next sections.

contents.rdf

contents.rdf describes what the theme consists of, such as a list of folders for the theme and other information.

The contents.rdf file contains a description of the files that make up the theme (see Listing 15.1).

In Listing 15.1, you need to replace all occurrences of THEME-NAME with the name of your theme. Replace YOUR NAME HERE with your name, a nickname, your company name, or whatever name you want to use. It is recommended that you include an email address as well in this space. In the chrome:description line, enter any description you want.

If you do not have all the folders described in the contents.rdf file, edit or delete as necessary. Each of your theme’s subfolders must be listed in the contents.rdf file. The contents.rdf file describes what makes up your theme. You should replace text that is in bold and italic in this listing. The text THEME-NAME should be changed to your theme’s name.

Example 15.1. The contents.rdf File

<?xml version="1.0"?>

<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
    
  <RDF:Seq about="urn:mozilla:skin:root">
    <RDF:li resource="urn:mozilla:skin:THEME-NAME" />
  </RDF:Seq>

  <RDF:Description about="urn:mozilla:skin:THEME-NAME"
         chrome:displayName="THEME-NAME"
         chrome:author="YOUR NAME HERE"
         chrome:description="THEME-NAME is based on an example from a book on Firefox. It
The contents.rdf File is compatible with Firefox Versions 1.x and later. There is for basic items, calendar,
The contents.rdf File downloadstatusbar, tabx, quicknote, offline, rss-reader, sage, and tbx. Tested with 
The contents.rdf File(whatever versions of Firefox you have tested your theme with)."
         chrome:name=" THEME-NAME"
         chrome:accessKey="l"
         chrome:image="preview.png">
     <chrome:packages>
       <RDF:Seq about="urn:mozilla:skin:THEME-NAME:packages">
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:communicator"/>
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:global"/>
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:browser"/>
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:inspector"/>
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:mozapps"/>
         <RDF:li resource="urn:mozilla:skin:THEME-NAME:help"/>
       </RDF:Seq>
    </chrome:packages>
  </RDF:Description>

  <!-- Version Information -->
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:communicator" chrome:skinVersion="1.5"/>
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:global" chrome:skinVersion="1.5"/>
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:browser" chrome:skinVersion="1.5"/>
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:inspector" chrome:skinVersion="1.5"/>
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:mozapps" chrome:skinVersion="1.5"/>
  <RDF:Description about="urn:mozilla:skin:THEME-NAME:help" chrome:skinVersion="1.5"/>

</RDF:RDF>

install.rdf

The install.rdf file describes the installation of your theme. This file has a relatively simple format (see Listing 15.2). You do, however, have to create a globally unique ID (GUID) for your theme. A GUID can be created using the tool at http://kruithof.xs4all.nl/uuid/uuidgen. This is only one of many sites on the Internet to do this. (You can, if you have Microsoft’s development platform, generate a GUID on your own computer.)

In Listing 15.2, do not forget the four lines directly below the line:

<doc:InlineComment> The Firefox versions that
 your theme will work on</doc:InlineComment>

You must enter both the earliest version of Firefox and the latest version of Firefox that your theme will work with. If you want the latest version of Firefox to be greater or equal to the version specified, add a plus sign (+) after the version as shown in Listing 15.2.

As with the contents.rdf file, you should edit and change any text shown in bold and italic in this listing.

Note

If you feel more comfortable generating your own GUIDs, you can download Microsoft’s GUIDGen program at http://www.microsoft.com/downloads/details.aspx?FamilyID=94551f58-484f-4a8c-bb39-adb270833afc&DisplayLang=en. To avoid typing in this complex URI, go to Microsoft’s website (http://www.microsoft.com/downloads). When in the Download Center, search for GUIDGen. This will take you to the GUIDGen download page.

Example 15.2. install.rdf Requires a Unique GUID and Some Minor Customization

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:id>{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</em:id>
    <doc:InlineComment>
          Replace the above xxx's with your theme's GUID.
    </doc:InlineComment>

    <em:version>1.0.9</em:version>

    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

        <doc:InlineComment> This GUID is for Firefox, so don't change it!
        </doc:InlineComment>
 
<doc:InlineComment> The Firefox versions that your theme will work on</doc:InlineComment>
         <em:minVersion>0.8</em:minVersion>
<doc:InlineComment> The earliest verson of Firefox that your theme will work on</doc
install.rdf Requires a Unique GUID and Some Minor Customization:InlineComment>
         <em:maxVersion>1.0+</em:maxVersion>
<doc:InlineComment> The newest verson of Firefox that your theme will work on</doc
install.rdf Requires a Unique GUID and Some Minor Customization:InlineComment>
      </Description>
    </em:targetApplication>

    <em:name>Bingo</em:name>
    <em:description>MY_THEME, my ultra simple theme</em:description>
    <em:creator>Your Name Here</em:creator>
    <em:contributor>Your name or company name</em:contributor>
    <em:homepageURL>Your web site URL</em:homepageURL>
    <em:internalName>MY_THEME</em:internalName>
  </Description>

</RDF>

icon.png

This is your theme’s icon as a PNG file. Convention says name it icon.png. This icon should be 32 × 32 pixels, 72 DPI, and 256 colors.

Note

A complete sample of our theme can be downloaded from http://www.quepublishing.com/title/0789734583. This sample is stored as a JAR file and can be installed into Firefox if you want; however, it won’t differ from the default Firefox theme.

Your icon can provide a transparent background using alpha channels. Either edit the existing file or create a new one. I recommend editing the original file for your first theme.

preview.png

This small image in Mozilla’s themes web page shows the user what your theme looks like. Most developers usually take a screenshot (cropped and resized) of part of Firefox with the theme loaded. Some theme developers use some form of a logo instead.

The preview.png image can be any size, but a recommendation is that it be between 150 × 75 pixels and 438 × 89 pixels, true color.

If you want, you can use preview.jpg or preview.gif for this file, but I recommend preview.png, which is easily created using a screen capture and Windows XP’s Paint program.

Other Folders and Files

All the other theme files can be edited and modified as necessary. Other than the four previously mentioned files, each file that is part of the theme is located in a subfolder.

Many theme developers create the images next and then rewrite the CSS files to reflect these images. Although your sample theme might have images of one size, you are not limited to that size—your images can be as small or large as practical.

When I start a theme, I begin with my background images. I like to use real things for backgrounds (such as wood and other textured surfaces). However, there is no reason not to use whatever fits your ideas for the theme. After the background images are installed correctly, I then start working on the button images. There are many of these, so a good idea is to print the existing images (blown up in size to show detail). After they’re printed, I can sketch my ideas on top of the printouts and then transfer these ideas to the actual image files.

You do not have to create all the buttons at one time; replace those you want. Later, you can replace other buttons with custom images. For my wood theme, I started with the main default browser toolbar buttons. I created back, forward, refresh, stop, and home buttons. After I situated these buttons, I created the remaining images.

Not all themes are complex. Some Firefox themes are simple, consisting of a few files and only changes in backgrounds, icons, and the like. Other themes are extensive, modifying many aspects of the Firefox user interface. Start simple, learn, and then go for more lofty goals.

Tip

An old programmer’s rule is to change only one thing at a time. That way, should things break, you are more likely to know what caused the failure.

At least initially, I recommend you do the same—work in small steps, changing one thing at a time and slowly building your theme.

Multibutton Images

Many of the button image files in Firefox have multiple button images. This reduces the number of files that must be opened, improving Firefox’s performance.

The image portion to be used is specified as shown in the following code snippet:

menuitem.bookmark-item {
  list-style-image: url("chrome://global/skin/icons/folder-item.png")
!important;
  -moz-image-region: rect(0px, 16px, 16px, 0px)
}

In this code, the image comes from the graphic file named folder-item.png. This image is 32 × 48 pixels in size. The part you want is defined by the –moz-image-region, specifically the rect() part. In rect() there are four parameters. In order (left to right) they are top, right, bottom, left. Think of a box and follow the perimeter in a clockwise manner, and you should remember which parameter is which.

Now, for this example you see that

top = 0

right = 16

bottom = 16

left = 0

So, the top and left are 0,0, or the upper-left corner of the image. (All images have an origin of 0,0 at their upper-left corner.) You also see that the right and bottom are both 16 pixels. You are taking a piece of this image starting at 0, 0 to 16, 16 to use as your button image (see Figure 15.2). The image is 16 pixels square, starting at pixel 0 and ending at pixel 15. The pixel at 16 is not included in this image.

The icon will be the one in the upper-left corner of the image.

Figure 15.2. The icon will be the one in the upper-left corner of the image.

After you have created your button images, you need some background images for the menu and toolbars.

Background Images

You need to have images for backgrounds. In my example, I used wood that I’d digitally scanned into the computer. (Using a scanner creates better-quality images if the source is reasonably flat.)

I started with three scans. I had two samples of wood (one was not real wood, but a laminate product) that I scanned. The scans I liked best were the scans of some teak I had. I adjusted the color balance to bring out the grain some, but otherwise the scans were usable without serious editing.

My theme has seven general wood images:

  • Page_wood.gif—A background for the browser’s display area. It is almost always covered by browser content (for example, web pages).

  • Vertical_wood.gif—A vertical band of wood, 70 × 1020 in size.

  • Menubar_wood.gif—Used as background in menu bars and toolbars.

  • Treecol_wood.gif—Used for tree view backgrounds.

  • Dark_wood.gif—A darker version of Treecol_wood.gif.

  • Dialogheader_wood.gif—Used as a dialog box header.

  • Button_wood.gif—A 64 × 65 image used with buttons.

It was necessary to work with about 16 CSS files, adding the background-image attribute lines.

An Example: global.css

There is no way to show all the modifications that went into generating my sample theme, wood. Instead I will concentrate on the global.css file, which was modified as needed.

In the global.css which I started with, was the following section:

/* ::::: root elements ::::: */

window,
page,
dialog,
wizard {
  -moz-appearance: window;
  background-color: -moz-Dialog;
  color: -moz-DialogText;
  font: message-box;
}

This piece of code defines the look of windows, pages, dialog boxes, and wizards. All four are defined with the same attributes (the attributes are enclosed in braces).

Originally the background color was defined as –moz-Dialog (a predefined color constant that varies with the background color of the user’s operating system dialog box).

The text color was defined as –moz-DialogText. Again, this color will be the same as the operating system’s dialog box text color.

The font for these four is message-box, a predefined font used as the default in message boxes. This is also based on the user’s operating system dialog box font.

Now, let’s split the four objects into two groups. The first group will have window, dialog, and wizard. The second group will be page:

/* ::::: root elements ::::: */
window,
dialog,
wizard {
  -moz-appearance: window;
  background-color: -moz-Dialog;
  color: -moz-DialogText;
  font: message-box;
  background-image: url(vertical_wood.gif);
}

For window, dialog, and wizard, you will use the image named vertical_wood.gif. This image is shown in Figure 15.3.

Vertical wood is a tall and not very wide (70 × 1020 image).

Figure 15.3. Vertical wood is a tall and not very wide (70 × 1020 image).

For page, a different image is used:

page {
   -moz-appearance: window;
/*  background-color: -moz-Dialog; */
  color: -moz-DialogText;
  font: message-box;
  background-image: url(Page_wood.gif);
}

page is set to the image page_wood.gif. This image is one of the largest images used in the theme (see Figure 15.4). It also has some graphics on it.

The page_wood.gif image has the theme name on it.

Figure 15.4. The page_wood.gif image has the theme name on it.

In global.css, I also added images to the following:

  • Statusbarpanel—Located at the bottom of the Firefox window.

  • Sidebarheader—Sidebars are along the left side of Firefox’s window (by default, some extensions allow moving them).

After I made my changes, I saved the global.css file and moved to the next CSS file until I had checked, and possibly modified, every CSS in the theme.

Tip

I strongly recommend checking the effect of your work after a few modifications. That way, if something breaks, you might be able to track down what is causing the problem.

Final Results

In creating my wood theme, I did the minimum necessary to show what can be done. Figure 15.5 shows Firefox before I created and installed my theme.

This is Firefox with the default theme installed.

Figure 15.5. This is Firefox with the default theme installed.

After I created my wooden theme, I created a JAR file and installed it in Firefox. Once installed, I then made it the active theme by clicking Use Theme at the bottom of the Themes dialog box (see Figure 15.6).

Firefox’s Themes dialog box shows both my theme (selected, but not yet in use) and the default theme.

Figure 15.6. Firefox’s Themes dialog box shows both my theme (selected, but not yet in use) and the default theme.

After I made wood the current theme, I needed to restart Firefox. Once restarted, I was using my new wood theme (see Figure 15.7).

This is Firefox with the new wood theme installed.

Figure 15.7. This is Firefox with the new wood theme installed.

You have now completed your theme. Like any good wood product, it will need sanding, polishing, updating, and additions before it is ready to publish.

Theme Writing Secrets for Power Users

Here are a few ideas from the experts:

  • Backing up is very important. You will make mistakes and will need to restore files.

  • Some minor changes in Firefox’s configuration, such as disabling the XUL cache and telling Firefox to load a theme that is not yet packaged in a jar, will make theme development much easier.

  • Determine what the theme should look like. Metal, wood, and animals are all possible theme topics. Check the Mozilla web pages to see whether there is already a theme similar to yours; if there is, find a different topic.

  • Create your background images to match your ideas on how the theme should look. Images can come from virtually anywhere, such as nature, people, or surfaces. Surfaces are the most common.

  • Leave the details, such as button images, until you have all the other visual aspects of the theme completed.

  • Firefox’s default theme, classic, can serve as a starting point for your theme, but you will have to provide a contents.rdf and an install.rdf file. You can download examples of both files from this book’s website.

  • Eventually your theme will need an icon and a preview image. Both can wait until you are done with your theme. Most preview images are a section of a screenshot of the theme.

  • JAR files can be hard to work with. WinZip, TUGZip, and Windows Explorer can help make JARs easier.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.153.224