\documentclass{article}
\usepackage{ulem}
\pagestyle{headings}
\begin{document}
\tableofcontents

Themes HowToLoading of CSS filesDefining theme colors and stylesAdding icon setsInteresting Links

\part{Themes HowTo}
\textbf{Colortext: NIThis information is valid for Horde 3 only. See Doc/Dev/ThemesH4\footnote{http://example.com/index.php?page=Doc/Dev/ThemesH4} for Horde 4 or Doc/Dev/Themes\footnote{http://example.com/index.php?page=Doc/Dev/Themes} for Horde 5 and later.Colortext: NI}

Creating a new theme for Horde is as simple as creating a new directory under \texttt{horde/themes/} and adding the files \texttt{info.php} and \texttt{screen.css}.

The \texttt{info.php} contains information regarding the stylesheet. For now this is limited to the name of the theme and an optional line to indicate substitution of icons.\newline
So, in its simplest form this file only needs to contain a single line:

\begin{verbatim}

$theme_name = _("My Theme Name");
\end{verbatim}

This is the theme name as it will appear in the theme list in the users' display options. The internally used theme name that you can use to set a default theme in \texttt{horde/config/prefs.php} is determined from the directory name you use.

Let's take the example of your new theme is in \texttt{horde/themes/mytheme/}, then the internal name of this theme would be "mytheme" while the users will see it as "My Theme Name".

If you want to contribute your theme to the Horde Project or make it publically available elsewhere, you should add some comments to the file header to explain where the theme comes from:

\begin{verbatim}

/**
 * This is my personal theme.
 * It is based on the colors of my bike when I was five.
 *
 * Copyright 2004 John Doe <john@example.com>
 */

$theme_name = _("My Theme Name");
\end{verbatim}

\section{Loading of CSS files}
The CSS files a theme is built on are loaded in a specific order. This is important to keep in mind if you want to override specific styles or make use of inheritance.\newline
CSS files are loaded in the following order, if they exist, where \textbf{application} is the currently loaded application and \textbf{theme} is the name of the active theme:

\renewcommand{\labelenumi}{\arabic{enumi}}
\begin{enumerate}
\item{horde/themes/screen.css}
\item{horde/themes/\textbf{theme}/screen.css}
\item{horde/\textbf{application}/themes/screen.css}
\item{horde/\textbf{application}/themes/\textbf{theme}/screen.css}
\end{enumerate}
\section{Defining theme colors and styles}
This alone doesn't make a theme of course, now you want to create you own set of colors and styles for your theme.

You can use the \texttt{screen.css} file to override the default Horde styles. It is a regular static css file, so if you know how CSS works and look at some of the existing theme files you could easily find out how to change certain colors, fonts, lines etc. You should \textsl{not} start with a copy of the "master" theme file \texttt{themes/horde/screen.css} but you should instead only define those CSS rules that you want to overwrite. This way you make sure that your theme doesn't miss any important style if the master theme file gets extended at some point in the future.

\section{Adding icon sets}
If you want to add custom icons to your theme you first need to create a \texttt{graphics/} folder in your theme's directory, in our example theme this would be \texttt{horde/themes/mytheme/graphics/}. Then you need to copy \textbf{all} the existing icons from the default theme directory \texttt{horde/themes/graphics/}, \textbf{including} any subdirectories, into your theme folder.

Now you need to create a file called \texttt{themed\_graphics} in any of your new theme folders that are going to contain theme icons. If you are going to provide theme icons for Horde and IMP, you would create the files \texttt{horde/themes/mytheme/themed\_graphics} and \texttt{horde/imp/themes/mytheme/themed\_graphics}. The \texttt{themed\_graphics} files can be empty.

Now start replacing the icons in your theme folder with your own ones. You may want to periodically run the script \texttt{horde/scripts/themes\_check.php} which will highlight any new icons that may have been added to the base theme that are missing in the other themes.

\section{Interesting Links}
\begin{itemize}
\item{Color Scheme Generator\footnote{http://colorschemedesigner.com/}}
\end{itemize}
\end{document}
